MHD may invoke the post iterator with a null key on a continuation
chunk (off > 0): the field name is supplied only on the first call and
not repeated. The no-file branch passed the raw key pointer into
std::string (via grow_last_arg / set_arg), which throws std::logic_error
on null. Because the throw escapes the C post-iterator callback, it
propagates as an uncaught exception and aborts the process via
std::terminate.
Guard key for null before constructing std::string: with no field name
there is nothing to store the value under, so accept and silently skip
the chunk (MHD_YES keeps the request alive; MHD_NO would abort it).
Same class of bug as the null-uri fix in uri_log (
#371).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session:
https://claude.ai/code/session_01Rkuh4aSmrD8m2f2vYqakb6