Skip to content
Snippets Groups Projects
Unverified Commit 3402e350 authored by Koen Zandberg's avatar Koen Zandberg
Browse files

sock_util: Prevent overflow in _find_pathstart

Limit the number of scanned chars in _find_pathstart to the predefined
size
parent b0309145
No related branches found
No related tags found
No related merge requests found
...@@ -105,8 +105,10 @@ static char* _find_hoststart(const char *url) ...@@ -105,8 +105,10 @@ static char* _find_hoststart(const char *url)
static char* _find_pathstart(const char *url) static char* _find_pathstart(const char *url)
{ {
size_t remaining = SOCK_HOSTPORT_MAXLEN;
char *urlpos = (char*)url; char *urlpos = (char*)url;
while(*urlpos) { while(*urlpos && remaining) {
remaining--;
if (*urlpos == '/') { if (*urlpos == '/') {
return urlpos; return urlpos;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment