From d64d9ddf6c92a39f8e1e6eb911700111b321ef28 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 13 Nov 2009 22:05:11 +0200 Subject: [PATCH] WPS: Fix http_link_update() to nul terminate the result --- src/wps/http_client.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/wps/http_client.c b/src/wps/http_client.c index d11649d70..b12c56018 100644 --- a/src/wps/http_client.c +++ b/src/wps/http_client.c @@ -344,7 +344,7 @@ char * http_link_update(char *url, const char *base) os_snprintf(n, len, "%s%s", base, url); } else { os_memcpy(n, base, pos - base); - os_memcpy(n + (pos - base), url, os_strlen(url)); + os_memcpy(n + (pos - base), url, os_strlen(url) + 1); } } else { pos = os_strrchr(base + 7, '/'); @@ -352,7 +352,8 @@ char * http_link_update(char *url, const char *base) os_snprintf(n, len, "%s/%s", base, url); } else { os_memcpy(n, base, pos - base + 1); - os_memcpy(n + (pos - base) + 1, url, os_strlen(url)); + os_memcpy(n + (pos - base) + 1, url, os_strlen(url) + + 1); } }