diff options
| author | ltning <ltning@noreply.codeberg.org> | 2025-02-04 18:38:41 +0000 |
|---|---|---|
| committer | ltning <ltning@noreply.codeberg.org> | 2025-02-04 18:38:41 +0000 |
| commit | 114ed37f9c3e57a840155b9b71fa9cdf0d7ec8d6 (patch) | |
| tree | 2a7747beb4d10fef57653ac1b91aed9469819dcd /xs_url.h | |
| parent | f6044d3aa0241a832b0ad1d2c394c0a1b814dbe3 (diff) | |
| parent | a2dde5dedaddb7fe91c061997e1314ba569c2edf (diff) | |
Merge branch 'master' into master
Diffstat (limited to 'xs_url.h')
| -rw-r--r-- | xs_url.h | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -17,12 +17,18 @@ xs_str *xs_url_dec(const char *str) xs_str *s = xs_str_new(NULL); while (*str) { + if (!xs_is_string(str)) + break; + if (*str == '%') { unsigned int i; if (sscanf(str + 1, "%02x", &i) == 1) { unsigned char uc = i; + if (!xs_is_string((char *)&uc)) + break; + s = xs_append_m(s, (char *)&uc, 1); str += 2; } @@ -69,7 +75,7 @@ xs_dict *xs_url_vars(const char *str) vars = xs_dict_new(); - if (str != NULL) { + if (xs_is_string(str)) { /* split by arguments */ xs *args = xs_split(str, "&"); |