????JFIF??x?x????'
Server IP : 79.136.114.73 / Your IP : 18.218.196.220 Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/self/root/home/b8009/php-5.6.22/ext/ereg/ |
Upload File : |
diff -u regex.orig/regerror.c regex/regerror.c --- regex.orig/regerror.c 2011-08-09 19:49:30.000000000 +0800 +++ regex/regerror.c 2011-08-12 10:45:57.000000000 +0800 @@ -8,6 +8,7 @@ #include "regex.h" #include "utils.h" #include "regerror.ih" +#include "php.h" /* = #define REG_OKAY 0 @@ -74,17 +75,19 @@ 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) break; if (errcode®_ITOA) { - if (r->code >= 0) - (void) strcpy(convbuf, r->name); - else - sprintf(convbuf, "REG_0x%x", target); + if (r->code >= 0) { + (void) strncpy(convbuf, r->name, sizeof(convbuf) - 1); + convbuf[sizeof(convbuf) - 1] = '\0'; + } else { + snprintf(convbuf, sizeof(convbuf), "REG_0x%x", target); + } assert(strlen(convbuf) < sizeof(convbuf)); s = convbuf; } else @@ -106,12 +109,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 +125,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 }