Skip to content

JS: console.getstr() causes Synchronet to crash if negative value is passed for the max length

From the Synchronet JS object model documentation:

console.getstr([string default_value] [,number maxlen=128] [,number k_mode=K_NONE] [,array history[]])

I'm currently using a Linux build from December 8 at 5:04PM (the latest code failed to build). I've noticed I can pass 0 for the 2nd argument (maxlen), but passing a negative value seems to cause Synchronet to crash. For instance:

var input = console.getstr("", -1, K_UPPER|K_NOSPIN|K_TRIM);

When that line of code ran for me, I was disconnected, and I saw this in the sbbs log output:

Dec 14 17:05:54 EO-BBS-NIX systemd[1]: sbbs.service: Main process exited, code=dumped, status=6/ABRT

Dec 14 17:05:54 EO-BBS-NIX systemd[1]: sbbs.service: Failed with result 'core-dump'.

Normally I'd update my binaries, but it's failing to build due to the following error:

make: *** No rule to make target 'js_archive.c', needed by 'gcc.linux.x64.obj.release-mt/js_archive.o'. Stop.