summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2024-06-02 21:48:00 -0400
committerWilliam Wilgus <wilgus.william@gmail.com>2024-06-02 21:48:00 -0400
commitce6fbe4382ea9abfb67d1343814b6772a9a6f7ab (patch)
tree356a7bfdeb7d453acf02b5ffb7894fe26e8e973f
parentf4a044e56110d03cc581c3be89be3117f76c90b0 (diff)
downloadrockbox-ce6fbe4382.tar.gz
rockbox-ce6fbe4382.zip
[coverity] cuesheet.c search_for_cursheet() if no dot strcpy to NULL
the logic here is a bit fuzzy to me maybe one of the copies to the cuepath buffer adds a dot but I don't see anything explicit Change-Id: Idcc469b5d04e4d9125b36df53d6aaa32a10f3bfd
-rw-r--r--apps/cuesheet.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/cuesheet.c b/apps/cuesheet.c
index bbdc93746e..2fe24d0a40 100644
--- a/apps/cuesheet.c
+++ b/apps/cuesheet.c
@@ -66,7 +66,8 @@ static bool search_for_cuesheet(const char *path, struct cuesheet_file *cue_file
if (strlcat(cuepath, slash, MAX_PATH) >= MAX_PATH)
goto skip; /* overflow */
dot = strrchr(cuepath, '.');
- strcpy(dot, ".cue");
+ if (dot)
+ strcpy(dot, ".cue");
if (!file_exists(cuepath))
{
skip: