Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nvim_buf_get_text() segfault with large negative column #28729

Open
vanaigr opened this issue May 13, 2024 · 1 comment · May be fixed by #28740
Open

nvim_buf_get_text() segfault with large negative column #28729

vanaigr opened this issue May 13, 2024 · 1 comment · May be fixed by #28740
Labels
api libnvim, Nvim RPC API bug-crash issue reporting a crash or segfault

Comments

@vanaigr
Copy link
Contributor

vanaigr commented May 13, 2024

Problem

Neovim crashes when calling nvim_buf_get_text() with a large negative start_col

Steps to reproduce

nvim --clean
:call nvim_buf_get_text(0, 0, -123456789, 0, 0, {})<cr>

Neovim version (nvim -v)

NVIM v0.10.0-dev-3119+gc7958356b

Operating system/version

Ubuntu 22.04.3 LTS

Terminal name/version

N/A

$TERM environment variable

xterm-256color

Installation

build from repo

@vanaigr vanaigr added the bug issues reporting wrong behavior label May 13, 2024
@vanaigr
Copy link
Contributor Author

vanaigr commented May 13, 2024

buf_get_text() doesn't clamp start_col after subtracting it from the line length.

@zeertzjq zeertzjq added api libnvim, Nvim RPC API bug-crash issue reporting a crash or segfault and removed bug issues reporting wrong behavior labels May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api libnvim, Nvim RPC API bug-crash issue reporting a crash or segfault
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants