You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.3 KiB
40 lines
1.3 KiB
From: Sipwise Development Team <support@sipwise.com>
|
|
Date: Mon, 4 Nov 2024 15:37:29 +0100
|
|
Subject: sipwise_fix_app_voicemail_bugs
|
|
|
|
---
|
|
apps/app_voicemail.c | 6 +++---
|
|
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
|
|
index 312be2a..df175fe 100644
|
|
--- a/apps/app_voicemail.c
|
|
+++ b/apps/app_voicemail.c
|
|
@@ -1326,7 +1326,7 @@ static int findreplen(const char *rep, int nmat, const int *replen)
|
|
while(*cp) {
|
|
if (*cp == '$' && isdigit(cp[1])) {
|
|
val = strtoul(&cp[1], &cp, 10);
|
|
- if (val && val <= nmat + 1)
|
|
+ if (val && val <= nmat)
|
|
len += replen[val -1];
|
|
else
|
|
fprintf(stderr, "repl %d out of range\n", val);
|
|
@@ -1346,7 +1346,7 @@ static void doreplace(char *out, const char *rep,
|
|
while(*cp) {
|
|
if (*cp == '$' && isdigit(cp[1])) {
|
|
val = strtoul(&cp[1], &cp, 10);
|
|
- if (val && val <= nmat + 1) {
|
|
+ if (val && val <= nmat) {
|
|
strncpy(out, repstr[val - 1], replen[val - 1]);
|
|
out += replen[val -1];
|
|
}
|
|
@@ -1393,7 +1393,7 @@ static char *pcre_subst(const pcre *ppat, const pcre_extra *extra,
|
|
int nmat;
|
|
int ovec[MAXCAPTURE * 3];
|
|
nmat = pcre_exec(ppat, extra, str, len, offset, options,
|
|
- ovec, sizeof(ovec));
|
|
+ ovec, sizeof(ovec) / sizeof(*ovec));
|
|
if (nmat <= 0)
|
|
return NULL;
|
|
return(edit(str, len, rep, nmat, ovec));
|