Module: kamailio
Branch: master
Commit: 97d8ebc966aba71efb3a964e71b00736db51401b
URL:
https://github.com/kamailio/kamailio/commit/97d8ebc966aba71efb3a964e71b0073…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-08-13T11:07:42+02:00
sipcapture: safety checks for values inside w_float2int()
---
Modified: src/modules/sipcapture/sipcapture.c
---
Diff:
https://github.com/kamailio/kamailio/commit/97d8ebc966aba71efb3a964e71b0073…
Patch:
https://github.com/kamailio/kamailio/commit/97d8ebc966aba71efb3a964e71b0073…
---
diff --git a/src/modules/sipcapture/sipcapture.c b/src/modules/sipcapture/sipcapture.c
index 8fb9deb16b..fdd736e7f9 100644
--- a/src/modules/sipcapture/sipcapture.c
+++ b/src/modules/sipcapture/sipcapture.c
@@ -1039,6 +1039,9 @@ static int w_float2int(struct sip_msg* _m, char* _val, char* _coof,
char* s2)
return -1;
}
+ if(value.s==NULL || coof.s==NULL)
+ return -1;
+
ret = (int) (atof (value.s) * atoi(coof.s));
return ret ? ret : -1;