mirror of
https://github.com/php/php-src.git
synced 2024-09-24 19:37:26 +00:00
Oops
This commit is contained in:
parent
b61c50a004
commit
f2bc53b88b
@ -474,7 +474,7 @@ PHPAPI char *php_ereg_replace(const char *pattern, const char *replace, const ch
|
||||
if (new_l + 1 > buf_len) {
|
||||
buf_len = 1 + buf_len + 2 * new_l;
|
||||
nbuf = emalloc(buf_len);
|
||||
strcpy(nbuf, buf, buf_len-1);
|
||||
strncpy(nbuf, buf, buf_len-1);
|
||||
efree(buf);
|
||||
buf = nbuf;
|
||||
}
|
||||
@ -511,7 +511,7 @@ PHPAPI char *php_ereg_replace(const char *pattern, const char *replace, const ch
|
||||
if (new_l + 1 > buf_len) {
|
||||
buf_len = 1 + buf_len + 2 * new_l;
|
||||
nbuf = safe_emalloc(buf_len, sizeof(char), 0);
|
||||
strcpy(nbuf, buf, buf_len-1);
|
||||
strncpy(nbuf, buf, buf_len-1);
|
||||
efree(buf);
|
||||
buf = nbuf;
|
||||
}
|
||||
@ -526,7 +526,7 @@ PHPAPI char *php_ereg_replace(const char *pattern, const char *replace, const ch
|
||||
if (new_l + 1 > buf_len) {
|
||||
buf_len = new_l + 1; /* now we know exactly how long it is */
|
||||
nbuf = safe_emalloc(buf_len, sizeof(char), 0);
|
||||
strcpy(nbuf, buf, buf_len-1);
|
||||
strncpy(nbuf, buf, buf_len-1);
|
||||
efree(buf);
|
||||
buf = nbuf;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user