mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-16 01:11:44 +00:00
Fix undefined behavior: null pointer passed as argument which is declared to never be null
git-svn-id: https://svn.eduke32.com/eduke32@5868 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
388c3832cd
commit
e99dbb858e
2 changed files with 3 additions and 2 deletions
|
@ -3491,7 +3491,8 @@ int32_t loaddefinitionsfile(const char *fn)
|
|||
DO_FREE_AND_NULL(faketilebuffer);
|
||||
faketilebuffersiz = 0;
|
||||
|
||||
qsort(usermaphacks, num_usermaphacks, sizeof(usermaphack_t), compare_usermaphacks);
|
||||
if (usermaphacks != NULL)
|
||||
qsort(usermaphacks, num_usermaphacks, sizeof(usermaphack_t), compare_usermaphacks);
|
||||
|
||||
if (!script) return -1;
|
||||
|
||||
|
|
|
@ -1711,7 +1711,7 @@ static void G_LoadMapHack(char *outbuf, const char *filename)
|
|||
|
||||
append_ext_UNSAFE(outbuf, ".mhk");
|
||||
|
||||
if (G_TryMapHack(outbuf))
|
||||
if (G_TryMapHack(outbuf) && usermaphacks != NULL)
|
||||
{
|
||||
usermaphack_t *pMapInfo = (usermaphack_t*)bsearch(
|
||||
&g_loadedMapHack, usermaphacks, num_usermaphacks, sizeof(usermaphack_t),
|
||||
|
|
Loading…
Reference in a new issue