krakjoe/apcu — pull request #100 by dmitry-saprykin (2014-12-09 11:57:40+00:00)
Title: * fixed possible segfault

Hello,

I have caught following segmentation fault on one of my servers:
```
#0 0x00007f11de61789e in apc_iterator_search_match (iterator=0x39b49d0, slot=0x7f11bf5a7548) at /usr/build/php/apcu-4.0.6/apc_iterator.c:183
key =
key_len =
rval = 1
#1 0x00007f11de61849e in apc_iterator_fetch_active (iterator=0x39b49d0) at /usr/build/php/apcu-4.0.6/apc_iterator.c:241
count = 56
slot =
item =
t = 1417933659
#2 0x000000000074fc32 in zend_call_function (fci=0x7fff0e4b1640, fci_cache=) at /usr/build/php/php-5.5.11/Zend/zend_execute_API.c:957
#3 0x0000000000775ba7 in zend_call_method (object_pp=0x7fff0e4b1768, obj_ce=, fn_proxy=0x319c3f0, function_name=0x87caa0 "rewind",
function_name_len=, retval_ptr_ptr=0x0, param_count=0, arg1=0x0, arg2=0x0) at /usr/build/php/php-5.5.11/Zend/zend_interfaces.c:97
```

when `(*slot)->next == NULL` we create reference to null pointer by following code `slot = &(*slot)->next;`
So I have changed type of `slot` to `apc_cache_slot_t *`

Could you merge this changes if it seem reasonable to you.

Kind regards,
Dmitry Saprykin