From 825ffaa168d6e89c76f3b74a15e5167082e1ab80 Mon Sep 17 00:00:00 2001 From: APGR22 <143316176+APGR22@users.noreply.github.com> Date: Fri, 17 May 2024 21:05:40 +0700 Subject: [PATCH] Added NULL pointer check (cherry picked from commit 961488b0dc992365adcc7f9c668da5e62afa3e00) (cherry picked from commit e4fc07cad074fade6182bbf9ca5e9df0ae785f95) --- src/SDL_hints.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/SDL_hints.c b/src/SDL_hints.c index ae4055d325..2455cc13a1 100644 --- a/src/SDL_hints.c +++ b/src/SDL_hints.c @@ -161,6 +161,10 @@ const char *SDL_GetHint(const char *name) const char *env; SDL_Hint *hint; + if (!name) { + return NULL; + } + env = SDL_getenv(name); for (hint = SDL_hints; hint; hint = hint->next) { if (SDL_strcmp(name, hint->name) == 0) {