summaryrefslogtreecommitdiff
path: root/uri.c
diff options
context:
space:
mode:
Diffstat (limited to 'uri.c')
-rw-r--r--uri.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/uri.c b/uri.c
index 10e7db6..55210a6 100644
--- a/uri.c
+++ b/uri.c
@@ -828,7 +828,7 @@ xmlURIUnescapeString(const char *str, int len, char *target) {
in = str;
out = ret;
while(len > 0) {
- if ((*in == '%') && (is_hex(in[1])) && (is_hex(in[2]))) {
+ if ((len > 2) && (*in == '%') && (is_hex(in[1])) && (is_hex(in[2]))) {
in++;
if ((*in >= '0') && (*in <= '9'))
*out = (*in - '0');