Skip to content

Commit fc6f97f

Browse files
bleeqerslouken
authored andcommitted
Fix NULL pointer dereference in SDL_GlobStorageDirectory
1 parent eb87a36 commit fc6f97f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/storage/generic/SDL_genericstorage.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ static bool GENERIC_EnumerateStorageDirectory(void *userdata, const char *path,
7979

8080
char *fullpath = GENERIC_INTERNAL_CreateFullPath((char *)userdata, path);
8181
if (fullpath) {
82-
wrap_data.base_len = SDL_strlen((char *)userdata);
82+
wrap_data.base_len = userdata ? SDL_strlen((char *)userdata) : 0;
8383
wrap_data.real_callback = callback;
8484
wrap_data.real_userdata = callback_userdata;
8585

0 commit comments

Comments
 (0)