]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #29925 (Added a check to prevent illegal characters in
authorIlia Alshanetsky <iliaa@php.net>
Fri, 3 Sep 2004 00:53:46 +0000 (00:53 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Fri, 3 Sep 2004 00:53:46 +0000 (00:53 +0000)
session key).

ext/session/session.c

index 67fe998b7a83b68839c962b7351ff5d816db8056..ac503175a4ac10b31b937b238324dc7e7379410e 100644 (file)
@@ -436,6 +436,11 @@ PS_SERIALIZER_ENCODE_FUNC(php)
 
        PS_ENCODE_LOOP(
                        smart_str_appendl(&buf, key, (unsigned char) key_length);
+                       if (memchr(key, PS_DELIMITER, key_length)) {
+                               PHP_VAR_SERIALIZE_DESTROY(var_hash);
+                               smart_str_free(&buf);                           
+                               return FAILURE;
+                       }
                        smart_str_appendc(&buf, PS_DELIMITER);
                        
                        php_var_serialize(&buf, struc, &var_hash TSRMLS_CC);