diff options
author | Jorge Arellano Cid <jcid@dillo.org> | 2013-07-25 17:44:35 -0400 |
---|---|---|
committer | Jorge Arellano Cid <jcid@dillo.org> | 2013-07-25 17:44:35 -0400 |
commit | e6fd6ea3c95343428570d4356734f66dc4908c40 (patch) | |
tree | 01c0ba90a8d8fadd0535856f7d9dd3f9889cc9ce | |
parent | f8e4370ec983f913d719244fe912c0433588445d (diff) |
Fixed an off-by-one read bug in the URL resolver
Problem details in bof-read-1_Url_resolve_relative.html.asan
(once again, assuming well-formedness is not a good idea)
-rw-r--r-- | src/url.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -263,7 +263,7 @@ static Dstr *Url_resolve_relative(const char *RelStr, } else if (BaseUrl->path) { /* relative path */ dStr_append(Path, BaseUrl->path); for (i = Path->len; --i >= 0 && Path->str[i] != '/'; ) ; - if (Path->str[i] == '/') + if (i >= 0 && Path->str[i] == '/') dStr_truncate(Path, ++i); } if (RelUrl->path) |