mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 9.0.2142: [security]: stack-buffer-overflow in option callback functions
Problem: [security]: stack-buffer-overflow in option callback functions Solution: pass size of errbuf down the call stack, use snprintf() instead of sprintf() We pass the error buffer down to the option callback functions, but in some parts of the code, we simply use sprintf(buf) to write into the error buffer, which can overflow. So let's pass down the length of the error buffer and use sprintf(buf, size) instead. Reported by @henices, thanks! Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
@@ -4968,6 +4968,8 @@ typedef struct
|
||||
// is parameterized, then the "os_errbuf" buffer is used to store the error
|
||||
// message (when it is not NULL).
|
||||
char *os_errbuf;
|
||||
// length of the error buffer
|
||||
int os_errbuflen;
|
||||
} optset_T;
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user