diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2021-08-06 19:37:13 +0100 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2021-08-06 19:38:06 +0100 |
commit | 257ba1d2e0d8048c488459762b2bca033815767f (patch) | |
tree | 46d4a054dd4ed6fe3e60ad72b78655bf40e5dc6d /apps | |
parent | 02b940396bb1fcb535e20dd5b5ada21ed7ce0ea7 (diff) | |
download | rockbox-257ba1d2e0d8048c488459762b2bca033815767f.tar.gz rockbox-257ba1d2e0d8048c488459762b2bca033815767f.zip |
Fix possible negative fd in playlist.c
Change-Id: I59d88609ec3f20ec9f482a777396cd72be23a35b
Diffstat (limited to 'apps')
-rw-r--r-- | apps/playlist.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/playlist.c b/apps/playlist.c index 2e28fc859d..49c52a9b7e 100644 --- a/apps/playlist.c +++ b/apps/playlist.c | |||
@@ -3707,7 +3707,7 @@ int playlist_save(struct playlist_info* playlist, char *filename, | |||
3707 | if (!rename(path, tmp_buf)) | 3707 | if (!rename(path, tmp_buf)) |
3708 | { | 3708 | { |
3709 | fd = open_utf8(tmp_buf, O_RDONLY); | 3709 | fd = open_utf8(tmp_buf, O_RDONLY); |
3710 | if (fsamefile(fd, playlist->fd) > 0) | 3710 | if (fd >= 0 && fsamefile(fd, playlist->fd) > 0) |
3711 | { | 3711 | { |
3712 | /* Replace the current playlist with the new one and update | 3712 | /* Replace the current playlist with the new one and update |
3713 | indices */ | 3713 | indices */ |