Module: sip-router
Branch: 3.3
Commit: ff72de945a70b9eedb6eca08677b93e618faeb94
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=ff72de9…
Author: Richard Fuchs <rfuchs(a)sipwise.com>
Committer: Richard Fuchs <rfuchs(a)sipwise.com>
Date: Mon Aug 13 13:10:37 2012 -0400
modules/lcr, modules_k/regex: Fix stack overflow from pcre_fullinfo(PCRE_INFO_SIZE)
Fix instances where pcre_fullinfo(PCRE_INFO_SIZE) was given only an "int"
argument, which results in stack overflow on some 64-bit platforms where
an "int" is only 32 bits long. It expects a "size_t" argument, which
is
64 bits long.
---
modules/lcr/lcr_mod.c | 3 ++-
modules_k/regex/regex_mod.c | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/modules/lcr/lcr_mod.c b/modules/lcr/lcr_mod.c
index 3bdcc98..d02d72f 100644
--- a/modules/lcr/lcr_mod.c
+++ b/modules/lcr/lcr_mod.c
@@ -758,7 +758,8 @@ static pcre *reg_ex_comp(const char *pattern)
{
pcre *re, *result;
const char *error;
- int rc, size, err_offset;
+ int rc, err_offset;
+ size_t size;
re = pcre_compile(pattern, 0, &error, &err_offset, NULL);
if (re == NULL) {
diff --git a/modules_k/regex/regex_mod.c b/modules_k/regex/regex_mod.c
index 51665aa..eb9f744 100644
--- a/modules_k/regex/regex_mod.c
+++ b/modules_k/regex/regex_mod.c
@@ -260,7 +260,7 @@ static int load_pcres(int action)
char line[FILE_MAX_LINE];
char **patterns = NULL;
pcre *pcre_tmp = NULL;
- int pcre_size;
+ size_t pcre_size;
int pcre_rc;
const char *pcre_error;
int pcre_erroffset;