You'll find the same functions in several other places already, scattered around the Linpac codebase. Eliminating duplicated headers is high on my personal "to do" list for Linpac internals, and I've actually started work on it in a local branch. Once the headers are centralised, getting common code in a single place will be the next logical step.
Integrate lptelnet package into Linpac proper
This was fixed 14 months ago (2019-02-11) on the develop branch. See: https://sourceforge.net/p/linpac/linpac/ci/2c78bb53df119e82511a957a1fe8f46e2aa1ba8c/
Integrate the lptelnet package
New functionality; bug fixes; documentation updates
Add minimal styling for readability
Fix a few misplaced tags
Significant revision and cleanup
Documentation for the shell API
Replace obsolete tt tag with code tag.
Regenerated text from substantially revised HTML
Fix initial scroll position in index view
Fix buffer overflow
Sign off before disconnecting
Gracefully handle missing messages
Fix confusing comment
Fix incorrect usage of vector::erase
Add a few minor debug niceties
Fix bug in modifying EventGate children
Add new command for integrated BBS mail retrieval
Fix message number lookup
Clean up mismatched allocations and frees
Fix line ends
Fix line ends
Fix stack corruption from blank lines in macros
Adjust ignores after moving files
Add support for PBBS message retrieval
Adjust build for moved mail utilities
Move mail tools into their own directory
Merge remote-tracking branch 'upstream/develop' into develop
Fix buffer overflow bugs
Fix possible buffer overflow in system info
Fix buffer overflow when reading long lines
Don't expect a response when none is required.
Don't send EasyComm I commands to EasyComm II rotators.
Fixes, corrections, and updates to the user manual.
Minor updates and corrections.
Minor changes to improve generated text.
Fix and sanitize some HTML rendering.
Fixes for language, typos, and the like.
Regenerated text manual from updated HTML.
Replace obsolete tt tag with code tag.
Fix incorrect character conversion indexing and add related docs.
Fix incorrect character conversion indexing.
Add a note about multi-byte encodings.
Fix bug in event gate when new process is created
Fix bug in event gate when new process is created
Fix several bugs in processing data from BBS
Fix several bugs in processing data from BBS
Fix badly broken config parsing in ulistd
Fix badly broken config parsing
Merge in cleanup of warnings and bug fixes.
Merge branch 'cleanup' into develop
Fix warning about ignoring system() result.
Fix warnings about signed array subscripts.
Fix warnings about unused variables and results.
Fix a bug in file name input handling.
Fix warnings about ambiguous 'else'; add braces.
Fix bugs related to mail header field lengths.
Fix warning about tmpnam; use mkstemp instead.
Address text pasting issues introduced by load reduction approach.
Correct loop control variable type.
Document the new EV_KEY_PRESS_MULTI event.
Add support for new EV_KEY_PRESS_MULTI event.
Fix a typo that appears in the mail UI.
Use the correct type (WINDOW) for ncurses windows.
Add support for new EV_KEY_PRESS_MULTI event.
Fix inconsistent args in wgetch() calls.
Use the correct type (WINDOW) for the key window.
Attached is a patch that combines the fix to the MonWindow constructor with the delete / free fixes to data.cc.
Hi David, To be clear, I haven't seen this segfault either. I was looking through the bug list here on SF, saw this one, looked at the associated code, and spotted an issue that could cause the reported segfault. I figured that was worth noting, along with a very minor change that would assist in nailing it down.
PMFJI. A few things: 1) The issue at windows.cc:877 is caused by a bug in the MonWindow constructor. The Window class defines a bunch of member variables, but has no constructor to initialise them, so it is up to derived classes to initialise them. MonWindow, derived from Window, fails to initialise conv (and convcnt), which belong to Window, so there's a random pointer here. Later, MonWindow::handle_event() tests conv and attempts to free it if it's non-null. Since it was not initialised, it is...
I see that MessageIndex::getMessage() does not protect against 'messages' being empty. If it is, index will be set to -1, and messages[index] will blow up. The behaviour of operator[] is undefined if the index is out of range, so a segfault is likely. Switching to messages.at(index) would cause an out_of_range exception to be thrown instead, since that function does bounds checking where operator[] does not. While that wouldn't solve the problem per se, it would allow us to determine whether in fact...