Commit Graph
16 Commits
Author SHA1 Message Date
Brad ArantandClaude Sonnet 5 05374bdb15 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>
2026-10-06 17:38:14 +00:00
Brad Arant 78c45d378c Fix File stat-before-open crash risk, JSON string-quoting bug, and MString buffer overflow
- File: stat() only after a successful open() (previously ran first with
  its result ignored, feeding a missing file's garbage st_size into a
  realloc - could crash the whole APIServer on a request for a
  nonexistent static asset)
- JString::setString(): always quote+escape the value instead of going
  through set()'s literal-value guess, which misclassified any string
  starting with digits (e.g. a UUID) as a bare numeric literal and wrote
  it unquoted, corrupting later edits to the same JSON document
- MString::remove() (both overloads): fixed an off-by-one that read one
  byte past the buffer on a completely full string (found via ASan under
  concurrent load)
- CGIFormData: added fields() so callers can iterate every parsed field
  without knowing names in advance (used to merge POST body into
  jet::Global::variables the same way query-string params already are)
2026-09-03 05:14:24 +00:00
barant 0ebe8eaf5b cleanup for valgrind. 2024-12-23 11:15:53 -08:00
Brad Arant 3eb1f5954a Modified ifNext to only take the ZString parameter and let C++ do the conversions. 2024-10-30 08:36:30 -07:00
Brad Arant 0ffc410a6a Fixed up File object to support better parameter options. 2024-07-09 14:29:15 -07:00
Brad Arant ab14fb3fcd Change return type on File::asZString. 2023-10-11 12:34:36 -07:00
Brad Arant 88d51cb598 Added support for MString in File 2022-11-19 10:18:09 -08:00
Brad Arant 2a349c6ceb Many fixes for MString, ZString. 2022-08-23 09:30:56 -07:00
Brad Arant eb48a5180d Fix File object. 2022-08-05 06:18:22 -07:00
Brad Arant 036978130d MString updates. 2022-07-28 08:06:33 -07:00
Brad Arant 287933f9ce Added ZString.c_str() function; Added MStrin operator=. 2022-07-16 21:33:55 -07:00
Brad Arant 91286649cc Eliminate includes file and include locally as required. 2022-02-14 07:04:20 -08:00
Brad Arant a37c4e6829 Updated and working. 2022-01-24 14:03:58 -08:00
Brad Arant c00476719c Added vscode 2020-11-07 17:25:37 -08:00
barant 947eef21e2 Continued work. 2020-03-03 15:46:24 -08:00
barant 08169b1c3d Many additions and changes. 2019-09-13 10:29:36 -07:00