fix seg in some edge cases

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13781 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris
2009-06-16 13:41:01 +00:00
parent 9c8901eef9
commit 5135dc03df
2 changed files with 8 additions and 2 deletions

View File

@@ -1688,6 +1688,10 @@ SWITCH_DECLARE(char *) switch_url_decode(char *s)
char *o;
unsigned int tmp;
if (switch_strlen_zero(s)) {
return s;
}
for (o = s; *s; s++, o++) {
if (*s == '%' && strlen(s) > 2 && sscanf(s + 1, "%2x", &tmp) == 1) {
*o = (char) tmp;