Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: etr/libhttpserver
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: etr/libhttpserver
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: fix/issue-375-null-key-post-iterator-v2
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 2 commits
  • 4 files changed
  • 2 contributors

Commits on Jun 29, 2026

  1. Fix null key dereference in post_iterator (#375)

    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. handle_post_form_arg passed the raw key pointer straight
    into std::string (via set_arg / grow_last_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).
    
    Adds unit/post_iterator_null_key_test.cpp pinning the regression (the
    test terminates without the guard) plus the happy-path initial and
    continuation-append cases.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01Rkuh4aSmrD8m2f2vYqakb6
    etr and claude committed Jun 29, 2026
    Configuration menu
    Copy the full SHA
    d491fb0 View commit details
    Browse the repository at this point in the history
  2. Add ChangeLog entry for #375 fix

    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01Rkuh4aSmrD8m2f2vYqakb6
    etr and claude committed Jun 29, 2026
    Configuration menu
    Copy the full SHA
    63da6da View commit details
    Browse the repository at this point in the history
Loading