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

ext/session/session.c

index 135a732253ac6e72cfcc609c428c2f297ab526de..0b16346eaa63177faca7b300e188c3a3eea204b3 100644 (file)
@@ -451,6 +451,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);