From 3d337642bd51aa6bd5e40fc5cdcc1b1062b1bdfc Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Tue, 2 Oct 2012 20:20:38 +0100 Subject: Don't let it read off the front of empty relative URLs. --- utils/nsurl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'utils') diff --git a/utils/nsurl.c b/utils/nsurl.c index 1107d67f9..80c364654 100644 --- a/utils/nsurl.c +++ b/utils/nsurl.c @@ -454,9 +454,9 @@ static void nsurl__get_string_markers(const char * const url_s, /* We got to the end of url_s. * Need to skip back over trailing whitespace to find end of URL */ pos--; - if (isspace(*pos)) { + if (pos >= url_s && isspace(*pos)) { trailing_whitespace = true; - while (isspace(*pos)) + while (pos >= url_s && isspace(*pos)) pos--; } -- cgit v1.2.3