diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2012-10-02 20:20:38 +0100 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2012-10-02 20:20:38 +0100 |
commit | 3d337642bd51aa6bd5e40fc5cdcc1b1062b1bdfc (patch) | |
tree | 4ebe69ca3456fd873d64d403baf317614e859e03 | |
parent | 541b87ec9b05d9af565bac54a4089b2b1b5ca34e (diff) | |
download | netsurf-3d337642bd51aa6bd5e40fc5cdcc1b1062b1bdfc.tar.gz netsurf-3d337642bd51aa6bd5e40fc5cdcc1b1062b1bdfc.tar.bz2 |
Don't let it read off the front of empty relative URLs.
-rw-r--r-- | utils/nsurl.c | 4 |
1 files changed, 2 insertions, 2 deletions
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--; } |