[vim/vim] libvterm: signed integer overflow parsing long CSI arguments (PR #19894)

6 views
Skip to first unread message

Christian Brabandt

unread,
Apr 2, 2026, 1:29:52 PM (13 hours ago) Apr 2
to vim/vim, Subscribed

Problem: Accumulating CSI argument digits without an upper bound causes
signed integer overflow when the argument exceeds LONG_MAX.
Solution: Skip further digit accumulation once the value would overflow
LONG_MAX.

Supported by AI


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/19894

Commit Summary

  • 20cccb9 libvterm: signed integer overflow parsing long CSI arguments

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19894@github.com>

mattn

unread,
Apr 2, 2026, 8:29:57 PM (6 hours ago) Apr 2
to vim/vim, Subscribed
mattn left a comment (vim/vim#19894)

I assume the (LONG_MAX - 9) / 10 style check was meant to avoid signed overflow in arg * 10 + digit. But I do not think that is quite the right boundary for CSI args here, since the parser is not really using the full long value domain for numeric arguments.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19894/c4181153527@github.com>

Reply all
Reply to author
Forward
0 new messages