game: fix an out-of-bounds read
cgame: fix an unitialized used var
cgame: fix an out-of-bounds read
ui: fix an uninitialized used var
ui: fix a possible out-of-bounds read