mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
coverity/331366: fname_trans_sid: Avoid buffer overrun
Since we're printf()ing into an offset of fname_buf, we need to reduce the max length by the same amount.
This commit is contained in:
parent
9bdbac6712
commit
d4fd139c2a
@ -537,7 +537,7 @@ static char_u *fname_trans_sid(const char_u *const name,
|
||||
if (current_sctx.sc_sid <= 0) {
|
||||
*error = ERROR_SCRIPT;
|
||||
} else {
|
||||
snprintf((char *)fname_buf + 3, FLEN_FIXED + 1, "%" PRId64 "_",
|
||||
snprintf((char *)fname_buf + i, FLEN_FIXED + 1 - i, "%" PRId64 "_",
|
||||
(int64_t)current_sctx.sc_sid);
|
||||
i = (int)STRLEN(fname_buf);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user