Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Bus error -- please leave by the rear door.


dovenet / Synchronet Programming / src/sbbs3/ansiterm.cpp

SubjectAuthor
o src/sbbs3/ansiterm.cppRob Swindell

1
src/sbbs3/ansiterm.cpp

<63543141.46048.syncprog@vert.synchro.net>

  copy mid

https://www.rocksolidbbs.com/dovenet/article-flat.php?id=59&group=DOVE-Net.Synchronet_Programming#59

  copy link   Newsgroups: DOVE-Net.Synchronet_Programming
From: rob.swindell@VERT (Rob Swindell)
To: Git commit to main/sbbs/master
Subject: src/sbbs3/ansiterm.cpp
Message-ID: <63543141.46048.syncprog@vert.synchro.net>
Date: Sat, 22 Oct 2022 04:06:57 -0700
X-Comment-To: Git commit to main/sbbs/master
Path: rocksolidbbs.com!not-for-mail
Organization: Vertrauen
Newsgroups: DOVE-Net.Synchronet_Programming
X-FTN-PID: Synchronet 3.20a-Linux new_user_dat/17aaf99a1 Oct 19 2022 GCC 8.3.0
X-FTN-MSGID: 46048.syncprog@1:103/705 27ba1b21
X-FTN-CHRS: CP437 2
WhenImported: 20221022110657-0700 c1e0
WhenExported: 20221022151858-0700 c1e0
ExportedFrom: VERT syncprog 46048
Content-Type: text/plain; charset=IBM437
Content-Transfer-Encoding: 8bit
 by: Rob Swindell - Sat, 22 Oct 2022 11:06 UTC

https://gitlab.synchro.net/main/sbbs/-/commit/6812da2fd3c14d77c0b5c401
Modified Files:
src/sbbs3/ansiterm.cpp
Log Message:
Fix CID 319174 (Out-of-bounds write) correctly

This Coverity reported issue was previously resolved (incorrectly) with
commit 0c441424 which also introduced a bug that ate all the unexpected
cursor position report characters (causing issue #304).

The correct fix was to compare the response length against the buffer size
minus one, to leave room for the NUL terminator.

While fixing this and issue #304, I noticed that this function was using the
response 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 stuffing
in the keyboard input buffer. So a bit of a refactor here using a proper
state machine variable.

---
■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net


dovenet / Synchronet Programming / src/sbbs3/ansiterm.cpp

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor