forked from len0rd/rockbox
[coverity] playlist.c format_track_path() guard NULL pointers
Change-Id: If029477ef9f38ee57b3afb7901d7429319675cc5
This commit is contained in:
parent
4829c2c894
commit
3b9d804bdf
1 changed files with 6 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue