On Wed, Oct 22, 2014 at 01:20:17AM +0200, ??ngel Gonz??lez wrote: > On 21/10/14 09:50, Giuseppe Scrivano wrote: > >??ngel, > >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 > The revert to the old behavior was only intended for checking it was the > right place. We have xstrndup() to do just what we want. Please test.
Build fails with: make[3]: Entering directory `/home/somlo/PROJECTS/CERT/WGETHACK/wget/src' gcc -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" -DLOCALEDIR=\"/usr/local/share/locale\" -I. -I../lib -I../lib -g -O2 -MT css-url.o -MD -MP -MF .deps/css-url.Tpo -c -o css-url.o css-url.c css-url.c:48:22: fatal error: xstrndup.h: No such file or directory #include <xstrndup.h> ^ compilation terminated. make[3]: *** [css-url.o] Error 1 There seems to be no "-I../gnulib/lib" on the gcc command line, which is probably why it can't find it. Thanks, --Gabriel > From 66ae9d897a4a2b7458a5d61230dc316befddd731 Mon Sep 17 00:00:00 2001 > From: =?UTF-8?q?=C3=81ngel=20Gonz=C3=A1lez?= <keis...@gmail.com> > 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)" > --- > src/ChangeLog | 4 ++++ > src/css-url.c | 3 ++- > 2 files changed, 6 insertions(+), 1 deletion(-) > > diff --git a/src/ChangeLog b/src/ChangeLog > index d5aeca0..6004c34 100644 > --- a/src/ChangeLog > +++ b/src/ChangeLog > @@ -1,3 +1,7 @@ > +2013-10-22 ??ngel Gonz??lez <keis...@gmail.com> > + > + * css-url.c (get_uri_string): Fix regression from 8e6de1fb5. > + > 2014-10-16 Tim Ruehsen <tim.rueh...@gmx.de> > > * url.c (url_parse): little code cleanup > diff --git a/src/css-url.c b/src/css-url.c > index c605798..2ac1cef 100644 > --- a/src/css-url.c > +++ b/src/css-url.c > @@ -45,6 +45,7 @@ as that of the covered work. */ > #include <stdlib.h> > #include <ctype.h> > #include <errno.h> > +#include <xstrndup.h> > > #include "wget.h" > #include "utils.h" > @@ -97,7 +98,7 @@ get_uri_string (const char *at, int *pos, int *length) > *length -= 2; > } > > - return xstrdup (at + *pos); > + return xstrndup (uri, at + *pos, *length);; > } > > void > -- > 2.1.2 >