Skip to content

libc/stream: Check lowout bounds before access#19329

Merged
jerpelea merged 1 commit into
apache:masterfrom
Old-Ding:codex/lowoutstream-bound-check
Jul 6, 2026
Merged

libc/stream: Check lowout bounds before access#19329
jerpelea merged 1 commit into
apache:masterfrom
Old-Ding:codex/lowoutstream-bound-check

Conversation

@Old-Ding

@Old-Ding Old-Ding commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary\n- check the output length before reading the current byte in lowoutstream_puts()\n- avoid reading str[0] for zero-length writes or str[len] after the buffer is consumed\n\n## Verification\n- git diff --check HEAD^ HEAD -- libs/libc/stream/lib_lowoutstream.c\n- git show --stat --check --format=fuller HEAD\n- git ls-files --eol -- libs/libc/stream/lib_lowoutstream.c

Check the provided length before reading the current lowoutstream byte. This avoids reading past zero-length or fully consumed buffers before the loop condition stops.

Generated-by: OpenAI Codex
Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
@Old-Ding Old-Ding requested a review from xiaoxiang781216 as a code owner July 6, 2026 01:12
@github-actions github-actions Bot added Area: OS Components OS Components issues Size: XS The size of the change in this PR is very small labels Jul 6, 2026
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

MemBrowse Memory Report

No memory changes detected for:

@jerpelea jerpelea merged commit bab2b4a into apache:master Jul 6, 2026
82 of 91 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: OS Components OS Components issues Size: XS The size of the change in this PR is very small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants