Module: kamailio
Branch: 4.4
Commit: 551a0d0f301bfc9e9ae92614511d073b13954701
URL:
https://github.com/kamailio/kamailio/commit/551a0d0f301bfc9e9ae92614511d073…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2017-10-11T18:35:06+02:00
core: add safety check to rval_get_tmp_str()
See #1263
(cherry picked from commit c6e921e45f1257913848110189eab82a34aa2f8b)
---
Modified: rvalue.c
---
Diff:
https://github.com/kamailio/kamailio/commit/551a0d0f301bfc9e9ae92614511d073…
Patch:
https://github.com/kamailio/kamailio/commit/551a0d0f301bfc9e9ae92614511d073…
---
diff --git a/rvalue.c b/rvalue.c
index a38a5246ea..921b4a0516 100644
--- a/rvalue.c
+++ b/rvalue.c
@@ -1102,7 +1102,11 @@ int rval_get_tmp_str(struct run_act_ctx* h, struct sip_msg* msg,
{
avp_t* r_avp;
int i;
-
+
+ if(rv==NULL) {
+ return -1;
+ }
+
switch(rv->type){
case RV_INT:
tmpv->s=sint2strbuf(rv->v.l, tmp_cache->i2s,