From 9d9f208d7e7a9f8d8ef3dc8b481f21e5db428471 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Fri, 7 May 2004 19:04:59 +0000 Subject: [PATCH] [project @ 2004-05-07 19:04:59 by bursa] Fix possible buffer under-read. svn path=/import/netsurf/; revision=840 --- utils/url.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/url.c b/utils/url.c index dcdfc14fc..ac4f74013 100644 --- a/utils/url.c +++ b/utils/url.c @@ -309,7 +309,8 @@ char *url_join(const char *rel, const char *base) } path_len = i; /* d) */ - if (buf[path_len - 2] == '/' && buf[path_len - 1] == '.') + if (2 <= path_len && buf[path_len - 2] == '/' && + buf[path_len - 1] == '.') path_len--; /* e) and f) */ while (1) {