Fix segmentation fault when parsing malformed URLs (e.g. "http:/").

This commit is contained in:
Martin Steghöfer 2014-10-05 19:28:03 +02:00
parent 1739c50622
commit a9012c7bfe
2 changed files with 2 additions and 2 deletions

View File

@ -188,7 +188,7 @@ ncuriparse(const char* uri0, NCURI** durip)
{THROW(6); /* illegal protocol*/}
/* skip // */
if(p[0] != '/' && p[1] != '/')
if(p[0] != '/' || p[1] != '/')
{THROW(7);}
p += 2;

View File

@ -186,7 +186,7 @@ ocuriparse(const char* uri0, OCURI** durip)
{THROW(6); goto fail; /* illegal protocol*/}
/* skip // */
if(p[0] != '/' && p[1] != '/')
if(p[0] != '/' || p[1] != '/')
{THROW(7); goto fail;}
p += 2;