summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRemi Collet <remi@php.net>2012-11-28 10:28:18 +0100
committerRemi Collet <remi@php.net>2012-11-28 10:28:18 +0100
commitf08060a48fadf079e860be73584ac87747dc59d6 (patch)
tree4b6ef8bde86c50b6c5d5aa7f6794a43a4b1320ca
parent1e6baa26734d827be6d279b111dcce6d2f39b6df (diff)
downloadphp-git-f08060a48fadf079e860be73584ac87747dc59d6.tar.gz
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.
-rw-r--r--sapi/fpm/fpm/fpm_events.c8
1 files changed, 6 insertions, 2 deletions
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);