https://gitlab.synchro.net/main/sbbs/-/commit/516bec839003aa00caf92836
Modified Files:
src/sbbs3/prntfile.cpp src/xpdev/dirwrap.c
Log Message:
Check FULLPATH() success in menu_exists_in() (CID 648908)
Coverity flagged the ignored _fullpath() return value in
menu_exists_in() (added in 151b9b5ca7, sports-3-formal) as a resource
leak. That's a false positive - with a non-NULL target buffer,
_fullpath() never allocates - but the return value is worth checking
anyway: on failure (e.g. cwd + relative path exceeding the buffer) the
output buffer is left an empty string, so fail the menu-exists check
explicitly rather than globbing on a relative ".<cols>col.<ext>" name.
Also fix a real leak Coverity didn't flag, nearby in the *nix
_fullpath() implementation itself: the getcwd(NULL, size)-allocated
buffer was not freed on the combined-path-length failure path. Plus an uncrustify whitespace normalization pass over dirwrap.c.
Validated with a jsexec fullpath() probe (happy path and an overlong
path driving the getcwd failure branch) and an isolated scratch
terminal server connect exercising the menu display path.
Co-Authored-By: Claude Fable 5 <
noreply@anthropic.com>
--- SBBSecho 3.37-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)