https://gitlab.synchro.net/main/sbbs/-/commit/6163a9df8ce36d7385251177
Modified Files:
exec/lbshell.js
Log Message:
lbshell.js: beep instead of crash on stray keys in the xtrn menu
When a keystroke that isn't a valid menu item leaks through the lightbar getval() in the external-programs ('x') handler, parseInt() of it yields
NaN or an out-of-range index, and the code dereferenced the array element without checking it existed:
- Section selection fed parseInt(x_sec) straight into new Xtrnsec(), whose
constructor immediately reads xtrn_area.sec_list[sec].prog_list -> the
"sec_list[sec] is undefined" TypeError seen in error.log.
- Program selection's own guard was the crash: it read .number off
prog_list[parseInt(x_prog)] which was undefined.
Validate the section index before constructing the submenu, and look the program up once with a null-check before dereferencing. A stray keystroke
now just beeps instead of throwing and dropping to the default shell.
Co-Authored-By: Claude Opus 4.8 <
noreply@anthropic.com>
(cherry picked from commit 074785210f01bdc40ecff0782984c7cfe02a5330)
--- SBBSecho 3.37-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)