Quick-rejection optimization in __PHYSFS_verifySecurity().
This commit is contained in:
parent
0eb5f71880
commit
b0a63caf40
3
physfs.c
3
physfs.c
|
@ -1200,6 +1200,9 @@ int __PHYSFS_verifySecurity(DirHandle *h, const char *fname)
|
||||||
char *end;
|
char *end;
|
||||||
char *str;
|
char *str;
|
||||||
|
|
||||||
|
if (*fname == '\0') /* quick rejection. */
|
||||||
|
return(1);
|
||||||
|
|
||||||
/* !!! FIXME: Can we ditch this malloc()? */
|
/* !!! FIXME: Can we ditch this malloc()? */
|
||||||
start = str = malloc(strlen(fname) + 1);
|
start = str = malloc(strlen(fname) + 1);
|
||||||
BAIL_IF_MACRO(str == NULL, ERR_OUT_OF_MEMORY, 0);
|
BAIL_IF_MACRO(str == NULL, ERR_OUT_OF_MEMORY, 0);
|
||||||
|
|
Loading…
Reference in New Issue