ioq3/code/ui
Simon McVittie 01bfb1540f UI_BuildFindPlayerList: avoid array underflow
This function is used in the Team Arena menus

I don't think it's actually possible to reach this line with
foundPlayerServerNames < 1, because by the time we get here we have
set it to 1 + the actual number of servers; but if we did, it would
clearly underflow into foundPlayerServerNames[-1], which would be
undefined behaviour. gcc 6 diagnoses this with a warning:

code/ui/ui_main.c: In function ‘UI_BuildFindPlayerList’:
code/ui/ui_main.c:4138:16: warning: array subscript is below array bounds [-Warray-bounds]

Also correct the sizeof() invocation to make it more obviously
correct (in fact the buffers for names and addresses happen to both
be of size MAX_ADDRESSLENGTH, so it was fine, but it's good to be
obvious).
2016-09-25 17:13:47 +01:00
..
ui_atoms.c Have ui_test cmd in missionpack ui return qtrue 2013-12-07 21:27:17 -06:00
ui_gameinfo.c REFACTOR [anough to enough] 2012-06-18 16:39:58 +00:00
ui_local.h renderer -> renderergl1, rend2 -> renderergl2 2013-02-15 23:46:37 +00:00
ui_main.c UI_BuildFindPlayerList: avoid array underflow 2016-09-25 17:13:47 +01:00
ui_players.c Make barrel/flash model name buffer safe 2015-01-12 22:35:20 -06:00
ui_public.h * Added STATUS 2005-10-29 01:53:09 +00:00
ui_shared.c Improve keyboard/joystick input in Team Arena UI 2016-05-23 09:06:34 -05:00
ui_shared.h Improve keyboard/joystick input in Team Arena UI 2016-05-23 09:06:34 -05:00
ui_syscalls.asm remove svn:executable property 2005-08-28 17:54:51 +00:00
ui_syscalls.c REFACTOR 2012-06-18 16:27:00 +00:00