diff options
author | Zeev Suraski <zeev@php.net> | 1999-06-07 15:01:25 +0000 |
---|---|---|
committer | Zeev Suraski <zeev@php.net> | 1999-06-07 15:01:25 +0000 |
commit | b886985d63c001bd2592d22c0c0b143cb95ebb7e (patch) | |
tree | 28a0a16c900ced11a4f88bc453cabc5e795771a4 | |
parent | 34b3dc9b470946bc35d8a33e49a6d8d8ab74c3f1 (diff) | |
download | php-git-b886985d63c001bd2592d22c0c0b143cb95ebb7e.tar.gz |
Fix an ereg_replace() crash bug
-rw-r--r-- | ext/ereg/ereg.c | 2 | ||||
-rw-r--r-- | ext/standard/reg.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/ext/ereg/ereg.c b/ext/ereg/ereg.c index c839e1ab12..1373933780 100644 --- a/ext/ereg/ereg.c +++ b/ext/ereg/ereg.c @@ -319,7 +319,7 @@ char *_php3_regreplace(const char *pattern, const char *replace, const char *str string_len = strlen(string); if (!string_len) - return (char *)string; + return estrndup("", 0); if (icase) copts = REG_ICASE; diff --git a/ext/standard/reg.c b/ext/standard/reg.c index c839e1ab12..1373933780 100644 --- a/ext/standard/reg.c +++ b/ext/standard/reg.c @@ -319,7 +319,7 @@ char *_php3_regreplace(const char *pattern, const char *replace, const char *str string_len = strlen(string); if (!string_len) - return (char *)string; + return estrndup("", 0); if (icase) copts = REG_ICASE; |