aboutsummaryrefslogtreecommitdiff
path: root/src/supplemental/http
diff options
context:
space:
mode:
authorManuel Saraiva <manuel.gustavo@gmail.com>2022-05-31 20:33:42 +0100
committerGitHub <noreply@github.com>2022-05-31 12:33:42 -0700
commit41ce9fbfd7a396816dab08dcb0284bab4329c622 (patch)
treedc59a7072a72b70cf3bd2284cb3cc8a81d51bd84 /src/supplemental/http
parent5f6127f69042fbb1f7ec25012c92fe1ebdbcedcb (diff)
downloadnng-41ce9fbfd7a396816dab08dcb0284bab4329c622.tar.gz
nng-41ce9fbfd7a396816dab08dcb0284bab4329c622.tar.bz2
nng-41ce9fbfd7a396816dab08dcb0284bab4329c622.zip
Fix out-of-bounds error in http_uri_canonify(). (#1595)
Diffstat (limited to 'src/supplemental/http')
-rw-r--r--src/supplemental/http/http_server.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/supplemental/http/http_server.c b/src/supplemental/http/http_server.c
index b7e7ac80..59863d2b 100644
--- a/src/supplemental/http/http_server.c
+++ b/src/supplemental/http/http_server.c
@@ -455,10 +455,11 @@ http_uri_canonify(char *path)
c += http_hexval(tmp[2]);
*dst++ = c;
tmp += 3;
+ } else {
+ // garbage in, garbage out
+ *dst++ = c;
+ tmp++;
}
- // garbage in, garbage out
- *dst++ = c;
- tmp++;
}
*dst = '\0';