From 3b9d804bdf854a52d4555212fed34b4274f7a090 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Fri, 7 Jun 2024 00:38:20 -0400 Subject: [coverity] playlist.c format_track_path() guard NULL pointers Change-Id: If029477ef9f38ee57b3afb7901d7429319675cc5 --- apps/playlist.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'apps') diff --git a/apps/playlist.c b/apps/playlist.c index 77e0ee4370..70637b39a2 100644 --- a/apps/playlist.c +++ b/apps/playlist.c @@ -555,6 +555,12 @@ static ssize_t format_track_path(char *dest, char *src, int buf_length, const char *dir, size_t dlen) { /* Look for the end of the string (includes NULL) */ + + if (!src || !dest || !dir) + { + DEBUGF("%s() bad pointer", __func__); + return -2; /* bad pointers */ + } size_t len = strcspn(src, "\r\n");; /* Now work back killing white space */ while (len > 0) -- cgit v1.2.3