Skip to content

Commit

Permalink
PRVM: fix null ptr deref in VM_getkeybind()
Browse files Browse the repository at this point in the history
Breaking commit was 26a665f

Fixes DarkPlacesEngine/DarkPlaces#133

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
  • Loading branch information
bones-was-here committed Apr 1, 2024
1 parent 02cc340 commit 89ab2a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion prvm_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/*
Expand Down

0 comments on commit 89ab2a5

Please sign in to comment.