summaryrefslogtreecommitdiff
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-3b9d804bdf854a52d4555212fed34b4274f7a090.tar.gz
rockbox-3b9d804bdf854a52d4555212fed34b4274f7a090.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,
555 const char *dir, size_t dlen) 555 const char *dir, size_t dlen)
556{ 556{
557 /* Look for the end of the string (includes NULL) */ 557 /* Look for the end of the string (includes NULL) */
558
559 if (!src || !dest || !dir)
560 {
561 DEBUGF("%s() bad pointer", __func__);
562 return -2; /* bad pointers */
563 }
558 size_t len = strcspn(src, "\r\n");; 564 size_t len = strcspn(src, "\r\n");;
559 /* Now work back killing white space */ 565 /* Now work back killing white space */
560 while (len > 0) 566 while (len > 0)