]> gitweb.ps.run Git - ps-cgit/blobdiff - html.c
html.c: avoid out-of-bounds access for url_escape_table
[ps-cgit] / html.c
diff --git a/html.c b/html.c
index 24a03a52b4042130a4da207ddafcfc370525658d..5b07aa0d9ee041b060e9bf99725b1bd3c47ce88b 100644 (file)
--- a/html.c
+++ b/html.c
@@ -162,7 +162,7 @@ void html_url_path(const char *txt)
 {
        const char *t = txt;
        while(t && *t){
-               int c = *t;
+               unsigned char c = *t;
                const char *e = url_escape_table[c];
                if (e && c!='+' && c!='&') {
                        html_raw(txt, t - txt);
@@ -179,7 +179,7 @@ void html_url_arg(const char *txt)
 {
        const char *t = txt;
        while(t && *t){
-               int c = *t;
+               unsigned char c = *t;
                const char *e = url_escape_table[c];
                if (c == ' ')
                        e = "+";