浏览代码

presence_dialoginfo: safety check for version placeholder

- don't set version attribute if the expected placeholder is not in
  place - related to FS#25
Daniel-Constantin Mierla 13 年之前
父节点
当前提交
f9589ba8fd
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      modules_k/presence_dialoginfo/notify_body.c

+ 5 - 0
modules_k/presence_dialoginfo/notify_body.c

@@ -316,6 +316,11 @@ str *dlginfo_body_setversion(subs_t *subs, str *body) {
 	}
 	version_start += 9;
 
+	/* safety check for placeholder - if it is body not set by the module,
+	 * don't update the version */
+	if(strncmp(version_start, "00000000000\"", 12)!=0)
+		return NULL;
+
 	version_len = snprintf(version, MAX_INT_LEN + 2,"%d\"", subs->version);
 	if (version_len >= MAX_INT_LEN + 2) {
 		LM_ERR("failed to convert 'version' to string\n");