Skip to content
Permalink
Browse files Browse the repository at this point in the history
better fix for prev commit
  • Loading branch information
davehorton committed Nov 28, 2022
1 parent 22c1bd1 commit bfc79d8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions libsofia-sip-ua/url/url.c
Expand Up @@ -364,8 +364,12 @@ char *url_canonize2(char *d, char const * const s, size_t n,
continue;
}

if (i >= strlen(s) - 1) return NULL;
h1 = s[i + 1], h2 = s[i + 2];
h1 = s[i + 1];
if (!h1) {
*d = '\0';
return NULL;
}
h2 = s[i + 2];

if (!IS_HEX(h1) || !IS_HEX(h2)) {
*d = '\0';
Expand Down Expand Up @@ -398,7 +402,6 @@ char *url_canonize2(char *d, char const * const s, size_t n,
return d;
}


/** Canonize a URL component (with precomputed mask).
*
* This version does not flag error if *s contains character that should
Expand Down

0 comments on commit bfc79d8

Please sign in to comment.