Fixed crash if SetMappingValue() is passed a NULL key

This commit is contained in:
Sam Lantinga 2023-07-19 09:23:08 -07:00
parent 58e3084477
commit 255f297439
1 changed files with 4 additions and 0 deletions

View File

@ -2463,6 +2463,10 @@ static char *SetMappingValue(char *mapping, const char *key, const char *value)
char **new_values = NULL;
SDL_bool result = SDL_FALSE;
if (!key) {
return mapping;
}
SplitMapping(mapping, &parts);
i = FindMappingKey(&parts, key);
if (i >= 0) {