Module: kamailio
Branch: 5.0
Commit: a3d53389992f2ca7798a530d24677206b8be668b
URL:
https://github.com/kamailio/kamailio/commit/a3d53389992f2ca7798a530d2467720…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Ãyvind Kolbu <oyvind.kolbu(a)usit.uio.no>
Date: 2017-10-25T10:51:16+02:00
sipcapture: safety checks for values inside w_float2int()
(cherry picked from commit 97d8ebc966aba71efb3a964e71b00736db51401b)
---
Modified: src/modules/sipcapture/sipcapture.c
---
Diff:
https://github.com/kamailio/kamailio/commit/a3d53389992f2ca7798a530d2467720…
Patch:
https://github.com/kamailio/kamailio/commit/a3d53389992f2ca7798a530d2467720…
---
diff --git a/src/modules/sipcapture/sipcapture.c b/src/modules/sipcapture/sipcapture.c
index a901236f46..99a1844c20 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;