summaryrefslogtreecommitdiff
path: root/modules/presence
diff options
context:
space:
mode:
authorJuha Heinanen <jh@tutpro.com>2016-03-13 10:34:43 +0200
committerJuha Heinanen <jh@tutpro.com>2016-03-13 10:34:43 +0200
commitffe31320d624f61afc536570853538c9df227254 (patch)
treed59d4ed854f2807da28a8b6c842ca5b36a735d2f /modules/presence
parentc72b65860f42c3cae92a76a8dc35ac6e6e61ad8c (diff)
modules/presence: in re_regex calls, added NULL result param for each []
in order to avoid crash
Diffstat (limited to 'modules/presence')
-rw-r--r--modules/presence/subscriber.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/modules/presence/subscriber.c b/modules/presence/subscriber.c
index f8a21e3..b6a6a5b 100644
--- a/modules/presence/subscriber.c
+++ b/modules/presence/subscriber.c
@@ -81,7 +81,7 @@ static void notify_handler(struct sip *sip, const struct sip_msg *msg,
enum presence_status status = PRESENCE_CLOSED;
struct presence *pres = arg;
const struct sip_hdr *type_hdr, *length_hdr;
- struct pl pl, ws1 = PL_INIT, ws2 = PL_INIT;
+ struct pl pl;
if (pres->shutdown)
goto done;
@@ -116,25 +116,25 @@ static void notify_handler(struct sip *sip, const struct sip_msg *msg,
}
if (!re_regex((const char *)mbuf_buf(msg->mb), mbuf_get_left(msg->mb),
- "<basic[ \t]*>[^<]+</basic[ \t]*>", &ws1, &pl, &ws2)) {
- if (!pl_strcasecmp(&pl, "open"))
- status = PRESENCE_OPEN;
+ "<basic[ \t]*>[^<]+</basic[ \t]*>", NULL, &pl, NULL)) {
+ if (!pl_strcasecmp(&pl, "open"))
+ status = PRESENCE_OPEN;
}
if (!re_regex((const char *)mbuf_buf(msg->mb), mbuf_get_left(msg->mb),
- "<rpid:away[ \t]*/>")) {
+ "<rpid:away[ \t]*/>", NULL)) {
status = PRESENCE_CLOSED;
}
else if (!re_regex((const char *)mbuf_buf(msg->mb),
mbuf_get_left(msg->mb),
- "<rpid:busy[ \t]*/>")) {
+ "<rpid:busy[ \t]*/>", NULL)) {
status = PRESENCE_BUSY;
}
else if (!re_regex((const char *)mbuf_buf(msg->mb),
mbuf_get_left(msg->mb),
- "<rpid:on-the-phone[ \t]*/>")) {
+ "<rpid:on-the-phone[ \t]*/>", NULL)) {
status = PRESENCE_BUSY;
}