DataReelDataReelC++ Toolkit Documentation

DataReel Code Review Fixes

DataReel Code Review and Fixes, 10/14/2026

These fixes are included in DataReel 6.0 and later (current release 6.2).

The DataReel library in this repository was reviewed and fixed by Claude Code, Anthropic's AI coding assistant (https://claude.ai/code). Every change in the source is marked with a "10/14/2026" comment. Function names and parameters did not change, but gxsXMLNode_t gained a member (see Fixes From the Documentation Review), so programs that use the XML parser must be recompiled against the new headers.

How the Code Was Reviewed
Memory Fixes
Undefined Behavior Fixes
Logic and Bounds Fixes
Deprecated API Updates
Compiler Warning Fixes
SSL Updates
Example Program Fixes
Documentation Updates
Fixes From the Documentation Review
Behavior Changes
Known Items Left as Is

How the Code Was Reviewed

Results after the fixes:

Memory Fixes

Memory allocated with new[] was freed with a scalar delete, which is undefined behavior and is reported by valgrind as a mismatched free. All of these now use delete[]:

src/ustring.cpp    UString buffers (allocate() and delete_sptr() now
                   use unsigned char arrays), UString/UStringw
                   constructors and the four temporary
                   conversion buffers
src/strutil.cpp    temporary ASCII and Unicode buffers
src/gxdbase.cpp    gxDatabase::Alloc() block buffer
src/gxdfptr.cpp    file name and copy buffer in dio_close() and
                   dio_seek()
src/gxrdbhdr.cpp   table field array
src/gxrdbms.cpp    secondary key field arrays
src/gxdstats.cpp   file signature buffer
src/ehandler.cpp   error string buffer
src/gxssl.cpp      random number tables
include/membuf.h   MemoryBuffer destructor

gxSocket::GetIPAddress(), GetDomainName(), GetBoundIPAddress() and GetRemoteHostName() allocated a new buffer when passed a null pointer. The caller never received the buffer, so it leaked. These functions now return -1 for a null buffer. GetRemoteHostName() also null terminates the name after strncpy().

Undefined Behavior Fixes

Logic and Bounds Fixes

Deprecated API Updates

Compiler Warning Fixes

SSL Updates

gxSSL (src/gxssl.cpp, include/gxssl.h) builds and runs with OpenSSL 3 and keeps the code paths for OpenSSL 1.1 and older.

MakeDHParms()

LoadDHParms()

MakeRSAPrivateKey()

MakeRSAEphKey()

MakeCertReq()

Release()

Documentation

ssl_server example

Example Program Fixes

Documentation Updates

New reference pages for classes and programs that had none:

All of them are listed in the Library, Examples and Utilities menus. The pages were written from the headers and source code, and they note behavior callers should know about.

classes/general/gxlistb.htm    gxListB non-template linked list
classes/thread/thrpool.htm     thrPool thread pool
classes/thread/thelpers.htm    thread mutex, condition and semaphore
                               helper functions
classes/socket/gxsxml.htm      gxsXML XML parser
classes/socket/gxsrss.htm      gxRSSfeed RSS feed writer
classes/database/gxrdbms.htm   gxRDBMS relational database layer
classes/database/btcache.htm   B-tree cache
classes/database/dbfcache.htm  database file cache
classes/database/dbugmgr.htm   database debug manager and statistics
utils/ix_debug.htm             index file debug utility
examples/programs.htm          guide to the example programs in the
                               examples_* folders

gxthread.htm now documents DestroyThreadPool() under its current name (it listed the misspelled DestoryThreadPool(), deprecated in 2003).

Modern page style:

Fixes From the Documentation Review

Writing the new reference pages meant reading each class line by line, which turned up the bugs below. Each fix was proven with a sanitizer test program that fails on the old code, and the pages describe the corrected behavior.

Relational database (gxrdbms.cpp, gxrdbms.h, gxrdbhdr.cpp)

Threads and lists (thelpers.cpp/.h, thrpool.cpp, gxthread.cpp, gxlistb.cpp)

XML parser and RSS feed writer (gxsxml.cpp/.h, gxsrss.cpp)

Caches and debug tools (btcache.cpp, dbfcache.cpp/.h, dbugmgr.cpp, gxdstats.cpp, utils/ix_debug)

Database engine (gxbtree.cpp, gxdbase.cpp)

Utilities

Example programs

Behavior Changes

Programs that use these functions may see different results:

Known Items Left as Is

10/24/2026: All of the items below are fixed in DataReel 6.0. See the DataReel 6.0 Release Notes.

DataReel Copyright (c) 2001-2026 DataReel Software Development