Files
mcde/lib/DtSvc
lotherkandClaude Sonnet 5.5 46606008b5 MCDE DtSvc: max_buf grows its buffer to the size asked for, not the old one (t0216)
CDE 2.5.3's max_buf (lib/DtSvc/DtUtil1/Dts.c) called realloc(buf, mb_size)
with the OLD size and only then stored the new one, so the buffer stayed at
MB_SIZE (100) bytes and DtDtsDataToDataType's strncpy and terminator wrote past
it.  dtwm aborted at start with 'malloc(): unsorted double linked list
corrupted' while the front panel read the data types.

Measured: valgrind on dtwm under Xvfb gave 'Invalid write of size 1, 0 bytes
after a block of size 100' (Dts.c:1321, block from max_buf Dts.c:303) and six
invalid-access contexts in all; after the change none, and dtwm runs 40 s under
valgrind and 8 s plain (before: status 134).  The two remaining reports are
struct and X-protocol padding.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-14 21:07:01 +00:00
..