Ángel,
Ángel González <[email protected]> writes:
> After a quick look, get_uri_string seems to not be taking into account
> the end of the url() parameter (it was before 8e6de1fb5).
> Can you check if this patch fixes the issue?
>
> diff --git a/src/css-url.c b/src/css-url.c
> index c605798..34a20af 100644
> --- a/src/css-url.c
> +++ b/src/css-url.c
> @@ -72,6 +72,8 @@ extern int yylex (void);
> static char *
> get_uri_string (const char *at, int *pos, int *length)
> {
> + char *uri;
> +
> if (0 != strncasecmp (at + *pos, "url(", 4))
> return NULL;
>
> @@ -97,7 +99,14 @@ get_uri_string (const char *at, int *pos, int *length)
> *length -= 2;
> }
>
> - return xstrdup (at + *pos);
> + uri = xmalloc (*length + 1);
> + if (uri)
> + {
> + strncpy (uri, at + *pos, *length);
> + uri[*length] = '\0';
> + }
> +
> + return uri;
> }
>
> void
thanks for the debugging effort! Would you mind to send a separate
patch that doesn't use strncpy (so to make make dist-check happy),
probably we can just use memcpy here.
Regards,
Giuseppe