Skip to content

CGI input/output correctness fixes#797

Open
b1tw153 wants to merge 4 commits into
drolbr:masterfrom
b1tw153:b1tw153/improve-cgi-binaries
Open

CGI input/output correctness fixes#797
b1tw153 wants to merge 4 commits into
drolbr:masterfrom
b1tw153:b1tw153/improve-cgi-binaries

Conversation

@b1tw153

@b1tw153 b1tw153 commented Jul 20, 2026

Copy link
Copy Markdown

cgi-helper.cc / cgi-helper.h

  • Read the POST body in 64 KB chunks up to max_input_size. Callers in user_interface.cc now pass the max_input_size value.
  • Correctly handle a truncated % escape at the end of the input.
  • Scope the '=' key/value delimiter search to the current query parameter instead of scanning ahead into the rest of the query string.

user_interface.cc

  • Normalize bbox=... coordinates to doubles before using them.
  • Substitute the (bbox) / [bbox] placeholders in a single pass instead of inserting values into the input string.
  • Widen the input-position and line-number counters to std::size_t.

output_custom_factory.cc

  • Verify the url parameter for [out:custom], matching the existing check for the template parameter.

processed_input.cc

  • Check operates_Mo_Fr / operates_Sa / operates_Su values before taking their fixed-offset substrings.

The changes preserve the prior behavior for well-formed requests.

b1tw153 added 4 commits July 13, 2026 09:25
…alue delimiter search to its segment instead of scanning the entire query string, and switch the POST body read to a faster bounded chunked read.
…lized coordinates; widen input-position counters to std::size_t.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant