mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 15:27:46 -04:00
fixes for memory leaks and out of bounds memory access found by ASAN or gcc -flto
This commit is contained in:
parent
bb70cc6e66
commit
a20300bf1e
8 changed files with 27 additions and 12 deletions
|
@ -131,8 +131,8 @@ static void fname_ext(char *dst, int dstlen, const char *prefix, const char *ext
|
|||
strncpy(dst + prefix_len, p, dstlen - prefix_len - 1);
|
||||
|
||||
dst[dstlen - 8] = 0;
|
||||
if (dst[strlen(dst) - 4] == '.')
|
||||
dst[strlen(dst) - 4] = 0;
|
||||
if ((p = strrchr(dst, '.')) != NULL)
|
||||
dst[p-dst] = 0;
|
||||
if (ext)
|
||||
strcat(dst, ext);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue