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();
	                     ^
This commit is contained in:
NRK
2022-04-24 06:17:44 +06:00
parent 3ab68dd361
commit b2ce5a9c54
+2 -1
View File
@@ -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")