Module: kamailio
Branch: master
Commit: e4e07a9cca8d91cb4acce8cbf7c8def9c3df06d9
URL:
https://github.com/kamailio/kamailio/commit/e4e07a9cca8d91cb4acce8cbf7c8def…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-10-01T08:43:22+02:00
posops: set index relative to the buffer for search functions
---
Modified: src/modules/posops/posops_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/e4e07a9cca8d91cb4acce8cbf7c8def…
Patch:
https://github.com/kamailio/kamailio/commit/e4e07a9cca8d91cb4acce8cbf7c8def…
---
diff --git a/src/modules/posops/posops_mod.c b/src/modules/posops/posops_mod.c
index 9c6f7d702f..5710b83da2 100644
--- a/src/modules/posops/posops_mod.c
+++ b/src/modules/posops/posops_mod.c
@@ -684,7 +684,7 @@ static int ki_posops_pos_search_helper(sip_msg_t *msg, int idx,
regex_t *re)
return -1;
}
- _posops_data.idx = (int)(msg->buf + idx + pmatch.rm_so);
+ _posops_data.idx = idx + pmatch.rm_so;
_posops_data.ret = (_posops_data.idx==0)?posops_idx0:_posops_data.idx;
_posops_data.len = pmatch.rm_eo-pmatch.rm_so;
@@ -757,7 +757,7 @@ static int ki_posops_pos_rsearch_helper(sip_msg_t *msg, int idx,
regex_t *re)
return -1;
}
- _posops_data.idx = (int)(msg->buf + i + pmatch.rm_so);
+ _posops_data.idx = i + pmatch.rm_so;
_posops_data.ret = (_posops_data.idx==0)?posops_idx0:_posops_data.idx;
_posops_data.len = pmatch.rm_eo-pmatch.rm_so;