cuesheet: Fix another possible buffer overflow with long filenames.
Change-Id: I9d8fa8fcb0a872f688664c53881fde93f2de9436
This commit is contained in:
parent
fe08ac4c2f
commit
2a471c9e84
1 changed files with 3 additions and 1 deletions
|
@ -73,11 +73,13 @@ bool look_for_cuesheet_file(struct mp3entry *track_id3, struct cuesheet_file *cu
|
|||
if (!dot || !file_exists(cuepath))
|
||||
{
|
||||
strcpy(cuepath, CUE_DIR);
|
||||
strlcat(cuepath, slash, MAX_PATH);
|
||||
if (strlcat(cuepath, slash, MAX_PATH) >= MAX_PATH)
|
||||
goto skip; /* overflow */
|
||||
char *dot = strrchr(cuepath, '.');
|
||||
strcpy(dot, ".cue");
|
||||
if (!file_exists(cuepath))
|
||||
{
|
||||
skip:
|
||||
if ((len+4) >= MAX_PATH)
|
||||
return false;
|
||||
strlcpy(cuepath, track_id3->path, MAX_PATH);
|
||||
|
|
Loading…
Reference in a new issue