[OpenWrt-Devel] [PATCH netifd 06/16] proto: Fix possible buffer overflow due to non null terminated string

Hans Dedecker dedeckeh at gmail.com
Mon Feb 1 04:56:20 EST 2016


Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---
 proto.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/proto.c b/proto.c
index eaec913..b91fcde 100644
--- a/proto.c
+++ b/proto.c
@@ -287,7 +287,7 @@ static bool
 parse_prefix_option(struct interface *iface, const char *str, size_t len)
 {
 	char buf[128] = {0}, *saveptr;
-	if (len > sizeof(buf))
+	if (len >= sizeof(buf))
 		return false;
 
 	memcpy(buf, str, len);
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list