[sr-dev] git:master:26249603: presence: fix crash when field value is null

GitHub noreply at github.com
Mon Aug 8 08:47:21 CEST 2016


Module: kamailio
Branch: master
Commit: 26249603066a13cdb8cb11b45af8410cd7adb82b
URL: https://github.com/kamailio/kamailio/commit/26249603066a13cdb8cb11b45af8410cd7adb82b

Author: lazedo <luis.azedo at factorlusitano.com>
Committer: GitHub <noreply at github.com>
Date: 2016-08-07T13:32:50+01:00

presence: fix crash when field value is null

---

Modified: modules/presence/notify.c

---

Diff:  https://github.com/kamailio/kamailio/commit/26249603066a13cdb8cb11b45af8410cd7adb82b.diff
Patch: https://github.com/kamailio/kamailio/commit/26249603066a13cdb8cb11b45af8410cd7adb82b.patch

---

diff --git a/modules/presence/notify.c b/modules/presence/notify.c
index 2a9b4d7..82ebf6b 100644
--- a/modules/presence/notify.c
+++ b/modules/presence/notify.c
@@ -2127,7 +2127,7 @@ int add_waiting_watchers(watcher_t *watchers, str pres_uri, str event)
 #define EXTRACT_STRING(strng, chars)\
 			do {\
 			strng.s = (char *) chars;\
-			strng.len = strlen(strng.s);\
+			strng.len = strng.s == NULL ? 0 : strlen(strng.s);\
 			} while(0);
 
 static int unset_watchers_updated_winfo(str *pres_uri)




More information about the sr-dev mailing list