Skip to content

Reject malformed MaxConnections values in TelnetAppender configuration#651

Merged
swebb2066 merged 1 commit into
apache:masterfrom
jmestwa-coder:telnet-maxconnections-validation
May 8, 2026
Merged

Reject malformed MaxConnections values in TelnetAppender configuration#651
swebb2066 merged 1 commit into
apache:masterfrom
jmestwa-coder:telnet-maxconnections-validation

Conversation

@jmestwa-coder
Copy link
Copy Markdown
Contributor

Summary

This patch hardens integer configuration parsing for TelnetAppender by rejecting malformed and out-of-range numeric values before they reach allocation-sensitive logic.

Previously, OptionConverter::toInt() relied on atol() narrowing behavior, which could silently accept overflowed, underflowed, or partially parsed values.

Changes

  • replace atol() narrowing in OptionConverter::toInt() with bounded strtoll() parsing

  • reject:

    • overflow values
    • underflow values
    • empty input
    • partial numeric parses
  • preserve valid integer parsing behavior

  • reject negative MaxConnections values before resize logic

  • remove signed/unsigned resize comparison hazards in TelnetAppender

Tests

Added regression coverage for:

  • malformed numeric input rejection
  • overflow and underflow handling
  • valid integer boundary parsing
  • TelnetAppender configuration fallback behavior

@swebb2066 swebb2066 merged commit 636049a into apache:master May 8, 2026
16 of 17 checks passed
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.

2 participants