https://gitlab.synchro.net/main/sbbs/-/commit/6812da2fd3c14d77c0b5c401
Modified Files:
src/sbbs3/ansiterm.cpp
Log Message:
Fix CID 319174 (Out-of-bounds write) correctlyThis Coverity reported issue was previously resolved (incorrectly) withcommit 0c441424 which also introduced a bug that ate all the unexpectedcursor position report characters (causing issue #304).The correct fix was to compare the response length against the buffer sizeminus one, to leave room for the NUL terminator.While fixing this and issue #304, I noticed that this function was using theresponse length ('rsp') as both the state machine state and string length,which didn't work right if a nearly-matching report/response was received:the x/y values would have been stripped from the response before stuffingin the keyboard input buffer. So a bit of a refactor here using a properstate machine variable.
--- SBBSecho 3.15-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)