From b2ce5a9c54b971cb918706cac73d20e6fbd7c930 Mon Sep 17 00:00:00 2001 From: NRK Date: Sun, 24 Apr 2022 06:17:44 +0600 Subject: [PATCH] ensure map isn't NULL main.c:1460:22: warning: Possible null pointer dereference: map [nullPointer] w3mFuncList[(int)map[c]].func(); ^ main.c:1503:24: note: Calling function 'escKeyProc', 3rd argument 'NULL' value is 0 escKeyProc((int)c, 0, NULL); ^ main.c:1438:25: note: Assuming condition is Assuming condition is false if (CurrentKey >= 0 && CurrentKey & K_MULTI) { ^ main.c:1460:22: note: Null pointer dereference w3mFuncList[(int)map[c]].func(); ^ --- main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 005d9b2..45f5a4b 100644 --- a/main.c +++ b/main.c @@ -1457,7 +1457,8 @@ escKeyProc(int c, int esc, unsigned char *map) esc |= (CurrentKey & ~0xFFFF); } CurrentKey = esc | c; - w3mFuncList[(int)map[c]].func(); + if (map) + w3mFuncList[(int)map[c]].func(); } DEFUN(escmap, ESCMAP, "ESC map")