mirror of
https://github.com/mirror/wget.git
synced 2025-01-14 22:30:44 +08:00
Fix buffer overflow in CSS parser
* src/css-url.c (get_urls_css): Check input string length * fuzz/wget_css_fuzzer.repro/negative-size-param-5724866467594240: Add reproducer corpus Fixes OSS-Fuzz issue #8032. This is a long standing bug affecting all versions <= 1.19.4.
This commit is contained in:
parent
acfd9b4d56
commit
cb47f3aaa4
@ -0,0 +1 @@
|
||||
@import
|
@ -143,7 +143,7 @@ get_urls_css (struct map_context *ctx, int offset, int buf_length)
|
||||
{
|
||||
uri = get_uri_string (ctx->text, &pos, &length);
|
||||
}
|
||||
else
|
||||
else if (length >= 2)
|
||||
{
|
||||
/* cut out quote characters */
|
||||
pos++;
|
||||
@ -152,6 +152,8 @@ get_urls_css (struct map_context *ctx, int offset, int buf_length)
|
||||
memcpy (uri, yytext + 1, length);
|
||||
uri[length] = '\0';
|
||||
}
|
||||
else
|
||||
uri = NULL;
|
||||
|
||||
if (uri)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user