Module: kamailio
Branch: master
Commit: 8b71c46ba0db05051ee24bf88491f00387e1ca8b
URL:
https://github.com/kamailio/kamailio/commit/8b71c46ba0db05051ee24bf88491f00…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-11-19T15:29:05+01:00
async: return error if trying to execute for faked message
- GH #1727
---
Modified: src/modules/async/async_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/8b71c46ba0db05051ee24bf88491f00…
Patch:
https://github.com/kamailio/kamailio/commit/8b71c46ba0db05051ee24bf88491f00…
---
diff --git a/src/modules/async/async_mod.c b/src/modules/async/async_mod.c
index d039ea0bd1..88affb3bbd 100644
--- a/src/modules/async/async_mod.c
+++ b/src/modules/async/async_mod.c
@@ -28,6 +28,7 @@
#include "../../core/sr_module.h"
#include "../../core/dprint.h"
#include "../../core/ut.h"
+#include "../../core/fmsg.h"
#include "../../core/pvar.h"
#include "../../core/timer_proc.h"
#include "../../core/route_struct.h"
@@ -153,6 +154,11 @@ static int w_async_sleep(sip_msg_t *msg, char *sec, char *str2)
if(msg == NULL)
return -1;
+ if(faked_msg_match(msg)) {
+ LM_ERR("invalid usage for faked message\n");
+ return -1;
+ }
+
if(async_workers <= 0) {
LM_ERR("no async mod timer workers (modparam missing?)\n");
return -1;
@@ -210,6 +216,11 @@ int ki_async_route(sip_msg_t *msg, str *rn, int s)
int ri;
sr_kemi_eng_t *keng = NULL;
+ if(faked_msg_match(msg)) {
+ LM_ERR("invalid usage for faked message\n");
+ return -1;
+ }
+
keng = sr_kemi_eng_get();
if(keng == NULL) {
ri = route_lookup(&main_rt, rn->s);
@@ -285,6 +296,11 @@ int ki_async_task_route(sip_msg_t *msg, str *rn)
int ri;
sr_kemi_eng_t *keng = NULL;
+ if(faked_msg_match(msg)) {
+ LM_ERR("invalid usage for faked message\n");
+ return -1;
+ }
+
keng = sr_kemi_eng_get();
if(keng == NULL) {
ri = route_lookup(&main_rt, rn->s);