From 58ee433b670140b1794c1d57f55fbb8c54b3332c Mon Sep 17 00:00:00 2001 From: Rob Kendrick Date: Wed, 5 Mar 2008 23:09:36 +0000 Subject: Add another check for malformed data: URLs svn path=/trunk/netsurf/; revision=3889 --- content/fetchers/fetch_data.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'content/fetchers/fetch_data.c') diff --git a/content/fetchers/fetch_data.c b/content/fetchers/fetch_data.c index 72c2557a9..60ccf13f4 100644 --- a/content/fetchers/fetch_data.c +++ b/content/fetchers/fetch_data.c @@ -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; } -- cgit v1.2.3