Module: kamailio
Branch: master
Commit: 74653204f45195944acc42979d0939cef9513cd4
URL:
https://github.com/kamailio/kamailio/commit/74653204f45195944acc42979d0939c…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-07-07T09:10:14+02:00
msrp: safety checks to avoid analyzer reports
---
Modified: src/modules/msrp/msrp_parser.c
---
Diff:
https://github.com/kamailio/kamailio/commit/74653204f45195944acc42979d0939c…
Patch:
https://github.com/kamailio/kamailio/commit/74653204f45195944acc42979d0939c…
---
diff --git a/src/modules/msrp/msrp_parser.c b/src/modules/msrp/msrp_parser.c
index 16c204b362..a6310cea93 100644
--- a/src/modules/msrp/msrp_parser.c
+++ b/src/modules/msrp/msrp_parser.c
@@ -642,7 +642,8 @@ int msrp_explode_str(str **arr, str *in, str *del)
{
if(in->s[i]==del->s[j])
{
- larr[k].len = in->s + i - larr[k].s;
+ if(k<n)
+ larr[k].len = in->s + i - larr[k].s;
k++;
if(k<n)
larr[k].s = in->s + i + 1;
@@ -650,7 +651,8 @@ int msrp_explode_str(str **arr, str *in, str *del)
}
}
}
- larr[k].len = in->s + i - larr[k].s;
+ if(k<n)
+ larr[k].len = in->s + i - larr[k].s;
*arr = larr;