Module: kamailio Branch: master Commit: d35d500588a3d337d5a9b6c3b30f4276a07e4ec6 URL: https://github.com/kamailio/kamailio/commit/d35d500588a3d337d5a9b6c3b30f4276a07e4ec6
Author: Daniel-Constantin Mierla <[email protected]> Committer: Daniel-Constantin Mierla <[email protected]> Date: 2026-06-15T16:16:25+02:00 ctl: bin rpc - check for size on printing --- Modified: src/modules/ctl/binrpc_run.c --- Diff: https://github.com/kamailio/kamailio/commit/d35d500588a3d337d5a9b6c3b30f4276a07e4ec6.diff Patch: https://github.com/kamailio/kamailio/commit/d35d500588a3d337d5a9b6c3b30f4276a07e4ec6.patch --- diff --git a/src/modules/ctl/binrpc_run.c b/src/modules/ctl/binrpc_run.c index 88f991a0067..9e57591bf16 100644 --- a/src/modules/ctl/binrpc_run.c +++ b/src/modules/ctl/binrpc_run.c @@ -1157,7 +1157,7 @@ static int rpc_rpl_printf(struct binrpc_ctx *ctx, char *fmt, ...) va_start(ap, fmt); len = vsnprintf(buf, RPC_PRINTF_BUF_SIZE, fmt, ap); va_end(ap); - if((len < 0) || (len > RPC_PRINTF_BUF_SIZE)) { + if((len < 0) || (len >= RPC_PRINTF_BUF_SIZE)) { LOG(L_ERR, "ERROR: binrpc: rpc_rpl_printf: buffer size exceeded(%d)\n", RPC_PRINTF_BUF_SIZE); goto error; @@ -1415,7 +1415,7 @@ static int rpc_struct_printf(struct rpc_struct_l *s, char *name, char *fmt, ...) va_start(ap, fmt); len = vsnprintf(buf, RPC_PRINTF_BUF_SIZE, fmt, ap); va_end(ap); - if((len < 0) || (len > RPC_PRINTF_BUF_SIZE)) { + if((len < 0) || (len >= RPC_PRINTF_BUF_SIZE)) { LOG(L_ERR, "ERROR: binrpc: rpc_struct_printf:" " buffer size exceeded(%d)\n", _______________________________________________ Kamailio - Development Mailing List -- [email protected] To unsubscribe send an email to [email protected] Important: keep the mailing list in the recipients, do not reply only to the sender!
