summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2024-06-07 00:38:20 -0400
committerWilliam Wilgus <wilgus.william@gmail.com>2024-06-07 00:38:20 -0400
commit3b9d804bdf854a52d4555212fed34b4274f7a090 (patch)
treeada2b0ef3283c432664de0651824bd8febdbffe7
parent4829c2c8940db72e3336d122293b0760ee8e1585 (diff)
downloadrockbox-3b9d804bdf.tar.gz
rockbox-3b9d804bdf.zip
[coverity] playlist.c format_track_path() guard NULL pointers
Change-Id: If029477ef9f38ee57b3afb7901d7429319675cc5
-rw-r--r--apps/playlist.c6
1 files changed, 6 insertions, 0 deletions
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)