Module: kamailio Branch: master Commit: 706dd0c9bf528881d758bc5c26f05870d8f22e35 URL: https://github.com/kamailio/kamailio/commit/706dd0c9bf528881d758bc5c26f05870...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2021-09-22T21:19:01+02:00
posops: adjust offset on negative index for update ops
---
Modified: src/modules/posops/posops_mod.c
---
Diff: https://github.com/kamailio/kamailio/commit/706dd0c9bf528881d758bc5c26f05870... Patch: https://github.com/kamailio/kamailio/commit/706dd0c9bf528881d758bc5c26f05870...
---
diff --git a/src/modules/posops/posops_mod.c b/src/modules/posops/posops_mod.c index 4c0c1b1535..8c538720ce 100644 --- a/src/modules/posops/posops_mod.c +++ b/src/modules/posops/posops_mod.c @@ -153,7 +153,7 @@ static int ki_posops_pos_append(sip_msg_t *msg, int idx, str *val) }
if(idx<0) { - offset = msg->len + idx + 1; + offset = msg->len + idx; } else { offset = idx; } @@ -206,7 +206,7 @@ static int ki_posops_pos_insert(sip_msg_t *msg, int idx, str *val) }
if(idx<0) { - offset = msg->len + idx + 1; + offset = msg->len + idx; } else { offset = idx; } @@ -259,7 +259,7 @@ static int ki_posops_pos_rm(sip_msg_t *msg, int idx, int len) return -1; } if(idx<0) { - offset = msg->len + idx + 1; + offset = msg->len + idx; } else { offset = idx; }