diff options
author | Daniel Silverstone <dsilvers@netsurf-browser.org> | 2008-10-13 16:39:54 +0000 |
---|---|---|
committer | Daniel Silverstone <dsilvers@netsurf-browser.org> | 2008-10-13 16:39:54 +0000 |
commit | 5c01ca3306f8ffdd8297042d56f2d2eb97af37aa (patch) | |
tree | be5a70ab056f717a38ed36c0c618382248bb318c /content/fetchers/fetch_data.c | |
parent | 1108d1d1c543b734fff61bd435c69c2efe2d7045 (diff) | |
download | netsurf-5c01ca3306f8ffdd8297042d56f2d2eb97af37aa.tar.gz netsurf-5c01ca3306f8ffdd8297042d56f2d2eb97af37aa.tar.bz2 |
Better, safer fix for the type punning issue
svn path=/trunk/netsurf/; revision=5562
Diffstat (limited to 'content/fetchers/fetch_data.c')
-rw-r--r-- | content/fetchers/fetch_data.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/content/fetchers/fetch_data.c b/content/fetchers/fetch_data.c index a24fcd1e9..30274f51e 100644 --- a/content/fetchers/fetch_data.c +++ b/content/fetchers/fetch_data.c @@ -141,6 +141,7 @@ static bool fetch_data_process(struct fetch_data_context *c) char *params; char *comma; char *unescaped; + int templen; /* format of a data: URL is: * data:[<mimetype>][;base64],<data> @@ -191,13 +192,11 @@ static bool fetch_data_process(struct fetch_data_context *c) /* we URL unescape the data first, just incase some insane page * decides to nest URL and base64 encoding. Like, say, Acid2. - * - * Note: the odd cast via void* is to prevent type-punning issues. - * we can be confident that size_t is at least as well aligned - * as int will be. */ - unescaped = curl_easy_unescape(curl, comma + 1, 0, (int *)((void *)&c->datalen)); - if (unescaped == NULL) { + templen = c->datalen; + unescaped = curl_easy_unescape(curl, comma + 1, 0, &templen); + c->datalen = templen; + if (unescaped == NULL) { fetch_data_send_callback(FETCH_ERROR, c, "Unable to URL decode data: URL", 0); return false; |