view src/proto/clientserver.pro @ 33864:6e4c686b6b5b v9.0.2142

patch 9.0.2142: [security]: stack-buffer-overflow in option callback functions Commit: https://github.com/vim/vim/commit/b39b240c386a5a29241415541f1c99e2e6b8ce47 Author: Christian Brabandt <cb@256bit.org> Date: Wed Nov 29 11:34:05 2023 +0100 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>
author Christian Brabandt <cb@256bit.org>
date Sun, 10 Dec 2023 15:16:04 +0100
parents 5e41b2e63c73
children
line wrap: on
line source

/* clientserver.c */
void server_to_input_buf(char_u *str);
char_u *eval_client_expr_to_string(char_u *expr);
int sendToLocalVim(char_u *cmd, int asExpr, char_u **result);
char_u *serverConvert(char_u *client_enc, char_u *data, char_u **tofree);
void exec_on_server(mparm_T *parmp);
void prepare_server(mparm_T *parmp);
void f_remote_expr(typval_T *argvars, typval_T *rettv);
void f_remote_foreground(typval_T *argvars, typval_T *rettv);
void f_remote_peek(typval_T *argvars, typval_T *rettv);
void f_remote_read(typval_T *argvars, typval_T *rettv);
void f_remote_send(typval_T *argvars, typval_T *rettv);
void f_remote_startserver(typval_T *argvars, typval_T *rettv);
void f_server2client(typval_T *argvars, typval_T *rettv);
void f_serverlist(typval_T *argvars, typval_T *rettv);
/* vim: set ft=c : */