瀏覽代碼

core: add safety check to rval_get_tmp_str()

See #1263
Victor Seva 8 年之前
父節點
當前提交
c6e921e45f
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/core/rvalue.c

+ 4 - 0
src/core/rvalue.c

@@ -1099,6 +1099,10 @@ 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,