From 9f54c1ff737f8c13de1efc9d2f92b0fd40952eb9 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Fri, 18 Dec 2015 16:40:02 +0800 Subject: [PATCH] uridecode no need to require length plus 2 length + 1 (for the '\0' is enough) Signed-off-by: Andy Green --- lib/parsers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/parsers.c b/lib/parsers.c index 2720b15..2b63fae 100644 --- a/lib/parsers.c +++ b/lib/parsers.c @@ -110,7 +110,7 @@ LWS_VISIBLE int lws_hdr_copy_fragment(struct lws *wsi, char *dst, int len, n++; } - if (wsi->u.hdr.ah->frags[f].len >= (len - 1)) + if (wsi->u.hdr.ah->frags[f].len >= len) return -1; memcpy(dst, &wsi->u.hdr.ah->data[wsi->u.hdr.ah->frags[f].offset], -- 2.7.4