summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2019-07-29 08:48:13 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2019-07-29 08:48:13 +0200
commit30eb4b3563f508019d306c3c62311f43d4ce6682 (patch)
treec50a68ad9a0e21ce511e61c0f5fe9313c3301f1b
parent5649267b257c78e46a934434c0bff894e0b5b694 (diff)
downloadphp-git-30eb4b3563f508019d306c3c62311f43d4ce6682.tar.gz
Fix #78342: Bus error in configure test for iconv //IGNORE
We have to check the return value of iconv_open() for error, to avoid that and potentially other undesired behavior of iconv().
-rw-r--r--NEWS4
-rw-r--r--ext/iconv/config.m43
2 files changed, 7 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index bb4dc2a5f5..b32589d7c2 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,10 @@ PHP NEWS
. Fixed bug #77946 (Bad cURL resources returned by curl_multi_info_read()).
(Abyr Valg)
+- Iconv:
+ . Fixed bug #78342 (Bus error in configure test for iconv //IGNORE). (Rainer
+ Jung)
+
- LiteSpeed:
. Updated to LiteSpeed SAPI V7.5 (Fixed clean shutdown). (George Wang)
diff --git a/ext/iconv/config.m4 b/ext/iconv/config.m4
index 6a056979e7..10b4e549fd 100644
--- a/ext/iconv/config.m4
+++ b/ext/iconv/config.m4
@@ -166,6 +166,9 @@ int main() {
int main() {
iconv_t cd = iconv_open( "UTF-8//IGNORE", "UTF-8" );
+ if(cd == (iconv_t)-1) {
+ return 1;
+ }
char *in_p = "\xC3\xC3\xC3\xB8";
size_t in_left = 4, out_left = 4096;
char *out = malloc(out_left);