Module: sip-router
Branch: master
Commit: f9589ba8fde7dc30ff98fee225e16c3f5440b213
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=f9589ba…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Wed Apr 4 12:14:40 2012 +0200
presence_dialoginfo: safety check for version placeholder
- don't set version attribute if the expected placeholder is not in
place - related to FS#25
---
modules_k/presence_dialoginfo/notify_body.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/modules_k/presence_dialoginfo/notify_body.c
b/modules_k/presence_dialoginfo/notify_body.c
index efa3b45..6a63d3e 100644
--- a/modules_k/presence_dialoginfo/notify_body.c
+++ b/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");