Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 612baae19b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -446,8 +446,6 @@ rb_linebuf_get(rb_buf_head_t * bufhead, char *buf, size_t buflen, bool partial, | |||
| size_t cpylen; | |||
| char *start, *ch; | |||
|
|
|||
There was a problem hiding this comment.
Guard zero-length buffers before computing copy length
Removing the buflen > 0 precondition in rb_linebuf_get allows buflen == 0 to fall through to cpylen = buflen - 1, which wraps cpylen to SIZE_MAX when there is queued data (bufline->len > 0) and then drives an out-of-bounds memcpy. Before this change, assert-enabled builds failed fast at function entry; now the same input can corrupt memory, so this path needs an explicit runtime check for zero-length destination buffers before the subtraction.
Useful? React with 👍 / 👎.
No description provided.