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.
Regards
>From 66ae9d897a4a2b7458a5d61230dc316befddd731 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=81ngel=20Gonz=C3=A1lez?= <[email protected]>
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 <[email protected]>
+
+ * css-url.c (get_uri_string): Fix regression from 8e6de1fb5.
+
2014-10-16 Tim Ruehsen <[email protected]>
* 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