Bug 1221444, r=bz

This commit is contained in:
Gijs Kruitbosch 2015-11-04 16:54:44 +00:00
parent b4d3a7dc94
commit 6897cafd81

View File

@ -169,7 +169,8 @@ nsDataHandler::ParseURI(nsCString& spec,
// First, find the start of the data
char *comma = strchr(buffer, ',');
if (!comma)
char *hash = strchr(buffer, '#');
if (!comma || (hash && hash < comma))
return NS_ERROR_MALFORMED_URI;
*comma = '\0';
@ -224,7 +225,6 @@ nsDataHandler::ParseURI(nsCString& spec,
// Split encoded data from terminal "#ref" (if present)
char *data = comma + 1;
char *hash = strchr(data, '#');
if (!hash) {
dataBuffer.Assign(data);
hashRef.Truncate();