Просмотр исходного кода

core: set to NULL the pointers to several sip msg fileds in cloned structure

- instance, ruid and location_ua are reset to null for the clone in shm,
  otherwise they point to pkg and the shm can be used from other
  process, resulting in crash
- reported and credits for testing and troubleshooting to Alex Balashov
Daniel-Constantin Mierla 12 лет назад
Родитель
Сommit
659b920399
1 измененных файлов с 11 добавлено и 0 удалено
  1. 11 0
      sip_msg_clone.c

+ 11 - 0
sip_msg_clone.c

@@ -539,6 +539,17 @@ struct sip_msg*  sip_msg_shm_clone( struct sip_msg *org_msg, int *sip_msg_len,
 	/* path_vec is not cloned (it's reset instead) */
 	new_msg->path_vec.s=0;
 	new_msg->path_vec.len=0;
+	/* instance is not cloned (it's reset instead) */
+	new_msg->instance.s=0;
+	new_msg->instance.len=0;
+	/* ruid is not cloned (it's reset instead) */
+	new_msg->ruid.s=0;
+	new_msg->ruid.len=0;
+	/* location ua is not cloned (it's reset instead) */
+	new_msg->location_ua.s=0;
+	new_msg->location_ua.len=0;
+	/* reg_id is not cloned (it's reset instead) */
+	new_msg->reg_id=0;
 	/* message buffers(org and scratch pad) */
 	memcpy( p , org_msg->buf, org_msg->len);
 	/* ZT to be safer */