From dc7e9b8c44815eb20ebef683641f94da6732be71 Mon Sep 17 00:00:00 2001 From: Christian Stadelmann Date: Mon, 2 Oct 2017 14:20:03 +0200 Subject: [PATCH] fix bug in calling memcpy Thanks to CONFIG_FORTIFY_SOURCE, the compiler refused to compile this buggy code. See https://outflux.net/blog/archives/2017/09/05/security-things-in-linux-v4-13/ for details why this issue hasn't been noticed before kernel 4.13. Fixes https://github.com/jurobystricky/Netgear-A6210/issues/81. --- os/linux/sta_ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os/linux/sta_ioctl.c b/os/linux/sta_ioctl.c index b374961..bb8625d 100644 --- a/os/linux/sta_ioctl.c +++ b/os/linux/sta_ioctl.c @@ -546,7 +546,7 @@ static int rt_ioctl_iwaplist(struct net_device *dev, struct iw_request_info *inf set_quality(pAd, &qual[i], pList); /*&pAd->ScanTab.BssEntry[i]); */ } data->length = i; - memcpy(extra, &addr, i*sizeof(addr[0])); + memcpy(extra, addr, i*sizeof(addr[0])); data->flags = 1; /* signal quality present (sort of) */ memcpy(extra + i*sizeof(addr[0]), &qual, i*sizeof(qual[i]));