mirror of
https://github.com/FunKey-Project/picodrive-irixxxx.git
synced 2026-04-30 09:59:35 +02:00
fixes for memory leaks and out of bounds memory access found by ASAN or gcc -flto
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user