You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2020/01/29 08:29:37 UTC
[incubator-nuttx-apps] branch master updated: netutils/netlib: Fix
buffer overflow
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git
The following commit(s) were added to refs/heads/master by this push:
new 59b763a netutils/netlib: Fix buffer overflow
59b763a is described below
commit 59b763add41ba2e971f55207d99b246669511001
Author: Alin Jerpelea <al...@sony.com>
AuthorDate: Wed Jan 29 14:22:01 2020 +0900
netutils/netlib: Fix buffer overflow
---
netutils/netlib/netlib_parsehttpurl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/netutils/netlib/netlib_parsehttpurl.c b/netutils/netlib/netlib_parsehttpurl.c
index a163b5c..f3235de 100644
--- a/netutils/netlib/netlib_parsehttpurl.c
+++ b/netutils/netlib/netlib_parsehttpurl.c
@@ -154,7 +154,7 @@ int netlib_parsehttpurl(FAR const char *url, FAR uint16_t *port,
/* The copy the rest of the file name to the user buffer */
- strncpy(dest, src, namelen);
+ strncpy(dest, src, bytesleft);
filename[namelen-1] = '\0';
return ret;
}