From 601b282cd8e7b2783f818469f55923e91cc4e1a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Gonz=C3=A1lez?= Date: Wed, 22 Oct 2014 01:10:21 +0200 Subject: [PATCH] css-url.c (get_uri_string): Fix regression from 8e6de1fb5 Solves the issue discovered by Gabriel Somlo and reported in the ml thread "Regression in git master branch (commit 8e6de1fb5ff0ca0c749da7db634a1b1e3a1215a2)" --- ChangeLog | 4 ++++ bootstrap.conf | 1 + src/ChangeLog | 4 ++++ src/css-url.c | 3 ++- 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d1b755a6..eca59dae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-10-22 Ángel González + + * bootstrap.conf (gnulib_modules): Add module xstrndup. + 2014-09-25 Tim Ruehsen * configure.ac: removed WgetTest.pm.in diff --git a/bootstrap.conf b/bootstrap.conf index bbfb38fb..11f5f924 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -78,6 +78,7 @@ update-copyright vasprintf vsnprintf write +xstrndup " gnulib_extra_files=" diff --git a/src/ChangeLog b/src/ChangeLog index d5aeca0d..bdc6844a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2013-10-22 Ángel González + + * css-url.c (get_uri_string): Honor the specified length argument. + 2014-10-16 Tim Ruehsen * url.c (url_parse): little code cleanup diff --git a/src/css-url.c b/src/css-url.c index c6057983..8ee4e8ca 100644 --- a/src/css-url.c +++ b/src/css-url.c @@ -52,6 +52,7 @@ as that of the covered work. */ #include "html-url.h" #include "css-tokens.h" #include "css-url.h" +#include "xstrndup.h" /* from lex.yy.c */ extern char *yytext; @@ -97,7 +98,7 @@ get_uri_string (const char *at, int *pos, int *length) *length -= 2; } - return xstrdup (at + *pos); + return xstrndup (at + *pos, *length); } void