From de2a0b8fa6c9f7dbee01ef989c4ca1f450a7af8b Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Thu, 3 Feb 2011 17:12:53 +0100 Subject: [PATCH] audiod get_play_time_slot_num(): Avoid possible NULL pointer dereference. The pointer to the buffer tree node is dereferenced unconditionally in btr_get_node_start(). This patch makes sure we never pass a NULL pointer to this function. --- audiod_command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audiod_command.c b/audiod_command.c index 05059ac0..a0d0229d 100644 --- a/audiod_command.c +++ b/audiod_command.c @@ -198,7 +198,7 @@ static int get_play_time_slot_num(void) FOR_EACH_SLOT(i) { struct slot_info *s = &slot[i]; struct timeval wstime; - if (!s->wns) + if (!s->wns || !s->wns[0].btrn) continue; btr_get_node_start(s->wns[0].btrn, &wstime); if (oldest_slot >= 0 && tv_diff(&wstime, &oldest_wstime, NULL) > 0) -- 2.39.5