Yasuo Ohgaki wrote:
> Thanks you for report :)
> Could you apply attached patch. It should fix the problem.
> Please let me know if this patch fixed it or not.
Oops I forgot take into account that it can return null string ;)
Try this one instead.
--
Yasuo Ohgaki
Index: mod_user.c
===================================================================
RCS file: /repository/php4/ext/session/mod_user.c,v
retrieving revision 1.17
diff -u -r1.17 mod_user.c
--- mod_user.c 30 Jul 2001 08:24:34 -0000 1.17
+++ mod_user.c 14 Dec 2001 07:59:14 -0000
@@ -125,16 +125,20 @@
SESS_ZVAL_STRING(key, args[0]);
retval = ps_call_handler(PSF(read), 1, args);
-
- if (retval) {
- if (retval->type == IS_STRING) {
- *val = estrndup(retval->value.str.val, retval->value.str.len);
- *vallen = retval->value.str.len;
- ret = SUCCESS;
- }
+
+ if (retval && Z_TYPE_P(retval) == IS_STRING) {
+ *val = estrndup(Z_STRVAL_P(retval), Z_STRLEN_P(retval));
+ *vallen = Z_STRLEN_P(retval);
+ ret = SUCCESS;
zval_ptr_dtor(&retval);
}
-
+ else {
+ php_error(E_WARNING,"User session read function must return string");
+ if (!retval) {
+ zval_ptr_dtor(&retval);
+ }
+ }
+
return ret;
}
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]