Skip to content

Commit f08060a

Browse files
committed
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.
1 parent 1e6baa2 commit f08060a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

sapi/fpm/fpm/fpm_events.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,9 @@ static int fpm_event_queue_del(struct fpm_event_queue_s **queue, struct fpm_even
188188
}
189189
if (q == *queue) {
190190
*queue = q->next;
191-
(*queue)->prev = NULL;
191+
if (*queue) {
192+
(*queue)->prev = NULL;
193+
}
192194
}
193195

194196
/* ask the event module to remove the fd from its own queue */
@@ -432,7 +434,9 @@ void fpm_event_loop(int err) /* {{{ */
432434
}
433435
if (q == fpm_event_queue_timer) {
434436
fpm_event_queue_timer = q->next;
435-
fpm_event_queue_timer->prev = NULL;
437+
if (fpm_event_queue_timer) {
438+
fpm_event_queue_timer->prev = NULL;
439+
}
436440
}
437441
q = q->next;
438442
free(q2);

0 commit comments

Comments
 (0)