mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-11-21 03:13:42 +08:00
Fix segmentation fault when parsing malformed URLs (e.g. "http:/").
This commit is contained in:
parent
1739c50622
commit
a9012c7bfe
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user