Fix MString::read() infinite retry loop, HTTPRequest parser fd leak, Log deadlock, log rotation symlink handling, and JString bounds checks
- MString::read() now gives up after repeated I/O errors instead of looping forever and crashing via realloc() failure (root cause of a recurring barant.com production crash). - HTTPRequest::parse() no longer leaks lineParser/headerParser on a malformed request. - Log gained size-based rotation (config-driven) and a non-static-mutex fix; a separate fix stopped rotation from destroying the logs symlink on its first trigger. - File.cpp: symlink-preserving rotation support. - JString: fixed an array-index out-of-bounds and a setString issue. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
694c6b80a4
commit
05374bdb15
7 files changed
+213
-14
No files matched your search
+14
@@ -393,6 +393,20 @@ namespace coreutils {
|
||||
throw coreutils::Exception("Path is expecting an array for selector value.");
|
||||
while (index > 0) {
|
||||
skipValue();
|
||||
// Reaching the array's closing bracket here means the
|
||||
// caller asked for an index past the last real element -
|
||||
// a legitimate "does this exist" probe (see exists()'s own
|
||||
// doc comment), not malformed JSON, and the one real
|
||||
// caller of this shape (BARANTMailConfig::getDkimEntries(),
|
||||
// walking a "dkim" array of unknown length ascending until
|
||||
// exists() first returns false) depends on getting a clean
|
||||
// "not found" back rather than an uncaught exception.
|
||||
// Confirmed live: querying one index past a real 2-element
|
||||
// array threw this unconditionally before, crashing server
|
||||
// startup outright instead of the config simply reporting
|
||||
// "no more entries".
|
||||
if (ifNext("]"))
|
||||
return false;
|
||||
if (!ifNext(","))
|
||||
throw coreutils::Exception("expecting comma to seperate array elements.");
|
||||
--index;
|
||||
|
||||
Reference in new issue
Block a user