10 changed files with 74 additions and 22 deletions
-
58ext/ereg/regex.patch
-
11ext/ereg/regex/regerror.c
-
2ext/ereg/regex/regerror.ih
-
4ext/standard/crypt.c
-
4ext/standard/http_fopen_wrapper.c
-
4ext/standard/proc_open.c
-
2ext/standard/user_filters.c
-
4ext/xml/xml.c
-
5main/fopen_wrappers.c
-
2main/streams/filter.c
@ -1,12 +1,62 @@ |
|||
Only in regex: regcomp.lo |
|||
Only in regex: regcomp.o |
|||
diff -u regex.orig/regerror.c regex/regerror.c
|
|||
--- regex.orig/regerror.c 2011-08-09 17:31:11.000000000 +0800
|
|||
+++ regex/regerror.c 2011-08-09 17:29:53.000000000 +0800
|
|||
@@ -82,7 +82,7 @@
|
|||
--- regex.orig/regerror.c 2011-08-09 19:49:30.000000000 +0800
|
|||
+++ regex/regerror.c 2011-08-09 19:46:15.000000000 +0800
|
|||
@@ -74,7 +74,7 @@
|
|||
char convbuf[50]; |
|||
|
|||
if (errcode == REG_ATOI) |
|||
- s = regatoi(preg, convbuf);
|
|||
+ s = regatoi(preg, convbuf, sizeof(convbuf));
|
|||
else { |
|||
for (r = rerrs; r->code >= 0; r++) |
|||
if (r->code == target) |
|||
@@ -82,9 +82,9 @@
|
|||
|
|||
if (errcode®_ITOA) { |
|||
if (r->code >= 0) |
|||
- (void) strcpy(convbuf, r->name);
|
|||
+ (void) strncpy(convbuf, r->name, 50);
|
|||
else |
|||
sprintf(convbuf, "REG_0x%x", target); |
|||
- sprintf(convbuf, "REG_0x%x", target);
|
|||
+ snprintf(convbuf, sizeof(convbuf), "REG_0x%x", target);
|
|||
assert(strlen(convbuf) < sizeof(convbuf)); |
|||
s = convbuf; |
|||
} else |
|||
@@ -106,12 +106,13 @@
|
|||
|
|||
/* |
|||
- regatoi - internal routine to implement REG_ATOI |
|||
- == static char *regatoi(const regex_t *preg, char *localbuf);
|
|||
+ == static char *regatoi(const regex_t *preg, char *localbuf, int bufsize);
|
|||
*/ |
|||
static char * |
|||
-regatoi(preg, localbuf)
|
|||
+regatoi(preg, localbuf, bufsize)
|
|||
const regex_t *preg; |
|||
char *localbuf; |
|||
+int bufsize;
|
|||
{ |
|||
register const struct rerr *r; |
|||
|
|||
@@ -121,6 +122,6 @@
|
|||
if (r->code < 0) |
|||
return("0"); |
|||
|
|||
- sprintf(localbuf, "%d", r->code);
|
|||
+ snprintf(localbuf, bufsize, "%d", r->code);
|
|||
return(localbuf); |
|||
} |
|||
diff -u regex.orig/regerror.ih regex/regerror.ih
|
|||
--- regex.orig/regerror.ih 2011-08-09 19:49:00.000000000 +0800
|
|||
+++ regex/regerror.ih 2011-08-09 19:41:07.000000000 +0800
|
|||
@@ -4,7 +4,7 @@
|
|||
#endif |
|||
|
|||
/* === regerror.c === */ |
|||
-static char *regatoi(const regex_t *preg, char *localbuf);
|
|||
+static char *regatoi(const regex_t *preg, char *localbuf, int bufsize);
|
|||
|
|||
#ifdef __cplusplus |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue