X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=server%2Ffastcgi.c;h=600632266c4d244428e8cdb04fea60bf82882841;hb=27ff700c938e48bd88ca63575d65575150d9e842;hp=94742bda2ac2d70a973a8d6a4906a0718a016c9c;hpb=2958589bf805b836b0cdec14e46949d6079939e4;p=matches%2FMCTX3420.git diff --git a/server/fastcgi.c b/server/fastcgi.c index 94742bd..6006322 100644 --- a/server/fastcgi.c +++ b/server/fastcgi.c @@ -164,7 +164,6 @@ bool FCGI_LockControl(FCGIContext *context, const char * user_name, UserType use * the key) has control or not. If validated, the context control_timestamp is * updated. * @param context The context to work in - * @param key The control key to be validated. * @return TRUE if authorized, FALSE if not. */ bool FCGI_HasControl(FCGIContext *context) @@ -386,7 +385,6 @@ void FCGI_BeginJSON(FCGIContext *context, StatusCodes status_code) * Generic accept response in JSON format. * @param context The context to work in * @param description A short description. - * @param cookie Optional. If given, the cookie field is set to that value. */ void FCGI_AcceptJSON(FCGIContext *context, const char *description) { @@ -510,7 +508,7 @@ void FCGI_WriteBinary(void * data, size_t size, size_t num_elem) /** * Escapes a string so it can be used safely. * Currently escapes to ensure the validity for use as a JSON string - * Does not support unicode specifiers in the form of \uXXXX. + * Does not support unicode specifiers in the form of \\uXXXX. * @param buf The string to be escaped * @return The escaped string (return value == buf) */ @@ -548,7 +546,7 @@ char *FCGI_EscapeText(char *buf) char *FCGI_URLDecode(char *buf) { char *head = buf, *tail = buf; - char hex[3] = {0}; + char val, hex[3] = {0}; while (*tail) { if (*tail == '%') { //%hh hex to char @@ -556,7 +554,9 @@ char *FCGI_URLDecode(char *buf) if (isxdigit(*tail) && isxdigit(*(tail+1))) { hex[0] = *tail++; hex[1] = *tail++; - *head++ = (char)strtol(hex, NULL, 16); + val = (char)strtol(hex, NULL, 16); + //Control codes --> Space character + *head++ = (val < 0x20) ? 0x20 : val; } else { //Not valid format; keep original head++; }