Subj : Fixed Segfault bug in internal editor
To   : Niels Haedecke
From : Andrew Leary
Date : Wed Jan 31 2024 11:31 am

Hello Niels!

31 Jan 24 07:37, you wrote to all:

NH> Hello, MBSE Developer Team,

NH> I have found and fixed an error with the 'HelP' window shown in the
NH> internal editor, which causes the editor to crash:

NH> 1.) Steps to reproduce:
NH>     - Enter a message in the internal editor
NH> - In the editor, press <ESC> and then <H> to display the help text
NH> window - Press a key to close the help text window - Try to continue
NH> to edit the message text -> an error message appears, then the BBS
NH> disconnects

NH> 2.) Root cause analysis:
NH>     - The function "void Full_Help(void)" in fsedit.c utilizes several
NH> helper functions to draw the help-text window. These helper functions
NH> access and manipulate the gobal variables "int Col" and "int Row"
NH> causing an overflow of the "Row" variable. This overflow will lead to
NH> a Segfault when "Refresh()" function is called before resuming editing
NH> of the text.

NH> 3.) Solution:
NH>     - i've added tow local variables "int hc" and "int hr" to the
NH> function "void Full_Help(void)" which are being used to temporary
NH> store the original values if "int Col" and "int Row" at the beginning
NH> of the function before drawing the help-text window. Once this is
NH> drawn, "int Col" and "int Row" are being assigned the original values
NH> temporarily stored in "int hc" and "int hr". That way, the call to
NH> "Refresh()" after drawing the help-text window will no longer crash
NH> and operate as intended.

NH> Do you want me to create a MR for this fix?

Please submit a diff to me at 1:320/219.  Thank you for your detailed bug
report and fix.

Regards,

Andrew
MBSE Development Team

--- GoldED+/LNX 1.1.5-b20230826
* Origin: Phoenix BBS * phoenix.bnbbbs.net (1:320/219)