uri: check presence of slash in suffix
If there's a slash in the uri_get_suffix() return value, then it's malformed. Return NULL in this case.
This commit is contained in:
parent
bad350bc18
commit
115d26608b
11
src/uri.c
11
src/uri.c
@ -33,9 +33,16 @@ bool uri_has_scheme(const char *uri)
|
||||
const char *
|
||||
uri_get_suffix(const char *uri)
|
||||
{
|
||||
const char *dot = strrchr(g_basename(uri), '.');
|
||||
const char *suffix = strrchr(g_basename(uri), '.');
|
||||
if (suffix == NULL)
|
||||
return NULL;
|
||||
|
||||
return dot != NULL ? dot + 1 : NULL;
|
||||
++suffix;
|
||||
|
||||
if (strchr(suffix, '/') != NULL)
|
||||
return NULL;
|
||||
|
||||
return suffix;
|
||||
}
|
||||
|
||||
char *
|
||||
|
Loading…
Reference in New Issue
Block a user