Module: kamailio Branch: master Commit: aeb9b5af7099ef3f8d3df02dcde1617fe22e4e46 URL: https://github.com/kamailio/kamailio/commit/aeb9b5af7099ef3f8d3df02dcde1617f...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2016-11-02T23:18:00+01:00
ctl: proper trim for long error messages to avoid out of bounds access
---
Modified: modules/ctl/binrpc_run.c
---
Diff: https://github.com/kamailio/kamailio/commit/aeb9b5af7099ef3f8d3df02dcde1617f... Patch: https://github.com/kamailio/kamailio/commit/aeb9b5af7099ef3f8d3df02dcde1617f...
---
diff --git a/modules/ctl/binrpc_run.c b/modules/ctl/binrpc_run.c index 5bdd869..e0d480f 100644 --- a/modules/ctl/binrpc_run.c +++ b/modules/ctl/binrpc_run.c @@ -503,7 +503,7 @@ static int rpc_fault_prepare(struct binrpc_ctx* ctx, int code, char* fmt, ...) } va_start(ap, fmt); len=vsnprintf(buf, MAX_FAULT_LEN, fmt, ap); /* ignore trunc. errors */ - if ((len<0) || (len > MAX_FAULT_LEN)) + if ((len<0) || (len >= MAX_FAULT_LEN)) len=MAX_FAULT_LEN-1; va_end(ap);