https://issues.shibboleth.net/jira/browse/SSPCPP-239
authorScott Cantor <cantor.2@osu.edu>
Mon, 24 Aug 2009 19:46:52 +0000 (19:46 +0000)
committerScott Cantor <cantor.2@osu.edu>
Mon, 24 Aug 2009 19:46:52 +0000 (19:46 +0000)
adfs/adfs.cpp
shib-target/shib-handlers.cpp

index d0b776c..bc1d5b3 100644 (file)
@@ -241,7 +241,7 @@ CgiParse::url_decode(char *url)
 
     for(x=0,y=0;url[y];++x,++y)
     {
-        if((url[x] = url[y]) == '%')
+        if((url[x] = url[y]) == '%' && isxdigit(url[y+1]) && isxdigit(url[y+2]))
         {
             url[x] = x2c(&url[y+1]);
             y+=2;
@@ -257,7 +257,7 @@ static inline char hexchar(unsigned short s)
 
 string CgiParse::url_encode(const char* s)
 {
-    static char badchars[]="\"\\+<>#%{}|^~[]`;/?:@=&";
+    static char badchars[]="\"\\+<>#%{}|^~[]`,;/?:@=&";
 
     string ret;
     for (; *s; s++) {
index 84c742d..701a9dd 100644 (file)
@@ -522,7 +522,7 @@ CgiParse::url_decode(char *url)
 
     for(x=0,y=0;url[y];++x,++y)
     {
-        if((url[x] = url[y]) == '%')
+        if((url[x] = url[y]) == '%' && isxdigit(url[y+1]) && isxdigit(url[y+2]))
         {
             url[x] = x2c(&url[y+1]);
             y+=2;
@@ -538,7 +538,7 @@ static inline char hexchar(unsigned short s)
 
 string CgiParse::url_encode(const char* s)
 {
-    static char badchars[]="\"\\+<>#%{}|^~[]()'`;/?:@=&";
+    static char badchars[]="\"\\+<>#%{}|^~[](),'`;/?:@=&";
 
     string ret;
     for (; *s; s++) {