[sr-dev] git:master:aeb9b5af: ctl: proper trim for long error messages to avoid out of bounds access
Daniel-Constantin Mierla
miconda at gmail.com
Thu Nov 3 09:16:05 CET 2016
Module: kamailio
Branch: master
Commit: aeb9b5af7099ef3f8d3df02dcde1617fe22e4e46
URL: https://github.com/kamailio/kamailio/commit/aeb9b5af7099ef3f8d3df02dcde1617fe22e4e46
Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at 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/aeb9b5af7099ef3f8d3df02dcde1617fe22e4e46.diff
Patch: https://github.com/kamailio/kamailio/commit/aeb9b5af7099ef3f8d3df02dcde1617fe22e4e46.patch
---
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);
More information about the sr-dev
mailing list