From: Remi Collet Date: Wed, 28 Nov 2012 09:28:18 +0000 (+0100) Subject: Fixed Bug #63581 Possible null dereference X-Git-Tag: php-5.3.20RC1~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f08060a48fadf079e860be73584ac87747dc59d6;p=php Fixed Bug #63581 Possible null dereference Possible NULL dereference when trying to delete the single item of a list (ack from fat). This issues where found from by static code analysis tool and, so, I can't provide any reproducer. --- diff --git a/sapi/fpm/fpm/fpm_events.c b/sapi/fpm/fpm/fpm_events.c index d5f7483b4f..d5835f0f7e 100644 --- a/sapi/fpm/fpm/fpm_events.c +++ b/sapi/fpm/fpm/fpm_events.c @@ -188,7 +188,9 @@ static int fpm_event_queue_del(struct fpm_event_queue_s **queue, struct fpm_even } if (q == *queue) { *queue = q->next; - (*queue)->prev = NULL; + if (*queue) { + (*queue)->prev = NULL; + } } /* ask the event module to remove the fd from its own queue */ @@ -432,7 +434,9 @@ void fpm_event_loop(int err) /* {{{ */ } if (q == fpm_event_queue_timer) { fpm_event_queue_timer = q->next; - fpm_event_queue_timer->prev = NULL; + if (fpm_event_queue_timer) { + fpm_event_queue_timer->prev = NULL; + } } q = q->next; free(q2);