netutils/netlib: Fix buffer overflow

This commit is contained in:
Alin Jerpelea 2020-01-29 14:22:01 +09:00 committed by Xiang Xiao
parent b6890df58d
commit 59b763add4

View File

@ -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;
}