diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c index e640f96f93221..ba68dfde9ec6d 100644 --- a/ext/session/mod_files.c +++ b/ext/session/mod_files.c @@ -674,10 +674,8 @@ PS_CREATE_SID_FUNC(files) /* Check collision */ /* FIXME: mod_data(data) should not be NULL (User handler could be NULL) */ if (data && ps_files_key_exists(data, sid) == SUCCESS) { - if (sid) { - zend_string_release_ex(sid, 0); - sid = NULL; - } + zend_string_release_ex(sid, 0); + sid = NULL; if (--maxfail < 0) { return NULL; } diff --git a/ext/session/session.c b/ext/session/session.c index 5c80cf3079ea5..5c8cf470b33f6 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -904,10 +904,9 @@ PS_SERIALIZER_DECODE_FUNC(php_binary) /* {{{ */ PHP_VAR_UNSERIALIZE_INIT(var_hash); for (p = val; p < endptr; ) { - // Can this be changed to size_t? - int namelen = ((unsigned char)(*p)) & (~PS_BIN_UNDEF); + size_t namelen = ((unsigned char)(*p)) & (~PS_BIN_UNDEF); - if (namelen < 0 || namelen > PS_BIN_MAX || (p + namelen) >= endptr) { + if (namelen > PS_BIN_MAX || (p + namelen) >= endptr) { PHP_VAR_UNSERIALIZE_DESTROY(var_hash); return FAILURE; } @@ -2910,7 +2909,7 @@ static PHP_MINFO_FUNCTION(session) /* {{{ */ /* Get serializer handlers */ for (i = 0, ser = ps_serializers; i < MAX_SERIALIZERS; i++, ser++) { - if (ser && ser->name) { + if (ser->name) { smart_str_appends(&ser_handlers, ser->name); smart_str_appendc(&ser_handlers, ' '); }