PHP_VAR_UNSERIALIZE_INIT(var_hash);
- for (p = q = val; (p < endptr) && (q = memchr(p, PS_DELIMITER, endptr - p)); p = q) {
+ p = val;
+
+ while (p < endptr) {
+ q = p;
+ while (*q != PS_DELIMITER)
+ if (++q >= endptr) goto break_outer_loop;
+
if (p[0] == PS_UNDEF_MARKER) {
p++;
has_value = 0;
}
PS_ADD_VARL(name, namelen);
efree(name);
+
+ p = q;
}
-
+break_outer_loop:
+
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
return SUCCESS;
int nrdels = -1;
nrand = (int) (100.0*php_combined_lcg());
- if (nrand <= PS(gc_probability)) {
+ if (nrand < PS(gc_probability)) {
PS(mod)->gc(&PS(mod_data), PS(gc_maxlifetime), &nrdels);
#if 0
if (nrdels != -1)