mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-03-09 16:51:34 +03:00
Add another check for malformed data: URLs
svn path=/trunk/netsurf/; revision=3889
This commit is contained in:
parent
b168d636d0
commit
58ee433b67
@ -133,13 +133,22 @@ static bool fetch_data_process(struct fetch_data_context *c)
|
||||
* data must still be there.
|
||||
*/
|
||||
|
||||
LOG(("*** Processing %s", c->url));
|
||||
|
||||
if (strlen(c->url) < 6) {
|
||||
/* 6 is the minimum possible length (data:,) */
|
||||
fetch_send_callback(FETCH_ERROR, c->parent_fetch,
|
||||
"Malformed data: URL", 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* skip the data: part */
|
||||
params = c->url + sizeof("data:") - 1;
|
||||
|
||||
/* find the comma */
|
||||
if ( (comma = strchr(params, ',')) == NULL) {
|
||||
fetch_send_callback(FETCH_ERROR, c->parent_fetch,
|
||||
"Badly formed data: URL", 0);
|
||||
"Malformed data: URL", 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user