diff mbox

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

Message ID 1454320590-20710-6-git-send-email-dedeckeh@gmail.com
State Accepted
Headers show

Commit Message

Hans Dedecker Feb. 1, 2016, 9:56 a.m. UTC
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
---
 proto.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

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);