mirror of
https://github.com/Oibaf66/uae-wii.git
synced 2024-11-22 10:39:19 +01:00
Check that path is non-NULL before dereferencing it
This commit is contained in:
parent
34f2bd18b5
commit
282002425b
@ -249,7 +249,7 @@ static int match_string (const char *table[], const char *str)
|
|||||||
char *cfgfile_subst_path (const char *path, const char *subst, const char *file)
|
char *cfgfile_subst_path (const char *path, const char *subst, const char *file)
|
||||||
{
|
{
|
||||||
/* @@@ use strcasecmp for some targets. */
|
/* @@@ use strcasecmp for some targets. */
|
||||||
if (strlen (path) > 0 && strncmp (file, path, strlen (path)) == 0) {
|
if (path && strlen (path) > 0 && strncmp (file, path, strlen (path)) == 0) {
|
||||||
int l;
|
int l;
|
||||||
char *p = xmalloc (strlen (file) + strlen (subst) + 2);
|
char *p = xmalloc (strlen (file) + strlen (subst) + 2);
|
||||||
strcpy (p, subst);
|
strcpy (p, subst);
|
||||||
|
Loading…
Reference in New Issue
Block a user