From 922a8a8bd4949b073e6423a0f0d59bb273d88014 Mon Sep 17 00:00:00 2001 From: Roman Smirnov Date: Tue, 2 Jul 2024 10:39:55 +0300 Subject: [PATCH] audio/a2dp: add NULL checks to find_remote_sep() Make find_remote_sep() safe for passing NULL pointers. Found with the SVACE static analysis tool. --- profiles/audio/a2dp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c index a3c294bc3..43da38051 100644 --- a/profiles/audio/a2dp.c +++ b/profiles/audio/a2dp.c @@ -1327,6 +1327,9 @@ static struct a2dp_remote_sep *find_remote_sep(struct a2dp_channel *chan, { struct avdtp_remote_sep *rsep; + if (!chan || !sep) + return NULL; + rsep = avdtp_find_remote_sep(chan->session, sep->lsep); return queue_find(chan->seps, match_remote_sep, rsep); -- 2.47.3