From: bones_was_here Date: Sun, 31 Mar 2024 19:21:01 +0000 (+1000) Subject: PRVM: fix null ptr deref in VM_getkeybind() X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=89ab2a529c8cc3f9ec29d0c51065c10a56eea8b2;p=xonotic%2Fdarkplaces.git PRVM: fix null ptr deref in VM_getkeybind() Breaking commit was 26a665ff43052862131df3c63785f91861989fc8 Fixes https://github.com/DarkPlacesEngine/darkplaces/issues/133 Signed-off-by: bones_was_here --- diff --git a/prvm_cmds.c b/prvm_cmds.c index f0605707..6a19baff 100644 --- a/prvm_cmds.c +++ b/prvm_cmds.c @@ -3428,7 +3428,7 @@ void VM_getkeybind (prvm_prog_t *prog) else bindmap = 0; // consistent to "bind" bind = Key_GetBind((int)PRVM_G_FLOAT(OFS_PARM0), bindmap); - PRVM_G_INT(OFS_RETURN) = PRVM_SetTempString(prog, bind, strlen(bind)); + PRVM_G_INT(OFS_RETURN) = bind ? PRVM_SetTempString(prog, bind, strlen(bind)) : 0; } /*