From: Hans Dedecker Date: Mon, 1 Feb 2016 09:56:20 +0000 (+0100) Subject: proto: Fix possible buffer overflow due to non null terminated string X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=commitdiff_plain;h=2475541608efec919ad3cbd0613f0f51fdbd50fd proto: Fix possible buffer overflow due to non null terminated string Signed-off-by: Hans Dedecker --- 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);