mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
sock_util: check path length in urlsplit
Add a length check to the path to ensure that it fits in the supplied buffer in the urlsplit function
This commit is contained in:
parent
d93ecab880
commit
bff8694051
@ -137,6 +137,9 @@ int sock_urlsplit(const char *url, char *hostport, char *urlpath)
|
||||
|
||||
size_t pathlen = strlen(pathstart);
|
||||
if (pathlen) {
|
||||
if (pathlen > SOCK_URLPATH_MAXLEN - 1) {
|
||||
return -EOVERFLOW;
|
||||
}
|
||||
memcpy(urlpath, pathstart, pathlen);
|
||||
}
|
||||
*(urlpath + pathlen) = '\0';
|
||||
|
Loading…
Reference in New Issue
Block a user