krakjoe / apcu

APCu - APC User Cache
Other
964 stars 196 forks source link

Also reject negative format values in APCuIterator #475

Open TysonAndre opened 1 year ago

TysonAndre commented 1 year ago

This would affect applications that accidentally or deliberately pass in negative values for $format (e.g. PHP_INT_MIN on 64-bit builds)

    if (format > APC_ITER_ALL) { /* 0xffffffff */
        apc_error("APCUIterator format is invalid");
        return;
    }
nikic commented 1 year ago

Doesn't looks that this error condition is tested currently, add one?

nikic commented 1 year ago

Looks like apc_099.phpt is failing.