]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
hex escape control and non 7-bit clean characters in uri_encode
authorDavid Vossel <dvossel@digium.com>
Mon, 7 Dec 2009 23:24:59 +0000 (23:24 +0000)
committerDavid Vossel <dvossel@digium.com>
Mon, 7 Dec 2009 23:24:59 +0000 (23:24 +0000)
In ast_uri_encode, non 7-bit clean characters were being hex escaped
correctly, but control characters were not.

(issue #16299)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@233609 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/utils.c

index 97991efe18b0e8ee8bf352049c344744171705f0..f835e11fcdddd0b8ade8f65400eb6ecf7483c712 100644 (file)
@@ -394,7 +394,7 @@ char *ast_uri_encode(const char *string, char *outbuf, int buflen, int doreserve
 
        /* If there's no characters to convert, just go through and don't do anything */
        while (*ptr) {
-               if (((unsigned char) *ptr) > 127 || (doreserved && strchr(reserved, *ptr)) ) {
+               if ((*ptr < 32) || (doreserved && strchr(reserved, *ptr))) {
                        /* Oops, we need to start working here */
                        if (!buf) {
                                buf = outbuf;