Bug #78642 [Ana->Csd]: Wrong version displayed
| From: | cmb@php.net | Date: | Tue, 08 Oct 2019 10:12:16 +0000 |
| Subject: | Bug #78642 [Ana->Csd]: Wrong version displayed | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-223132@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78642&edit=1
ID: 78642
Updated by: cmb@php.net
Reported by: gedas at martynas dot it
Summary: Wrong version displayed
-Status: Analyzed
+Status: Closed
Type: Bug
Package: ICONV related
Operating System: CentOS 7
PHP Version: 7.2.23
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=195c2008e8f25040130e597f46cd652829c84dba
Log: Fix #78642: Wrong libiconv version displayed
Previous Comments:
------------------------------------------------------------------------
[2019-10-08 08:45:52] cmb@php.net
Thanks for reporting and the patch!
------------------------------------------------------------------------
[2019-10-07 19:52:36] gedas at martynas dot it
The following patch has been added/updated:
Patch Name: iconv.c.patch
Revision: 1570477956
URL: https://bugs.php.net/patch-display.php?bug=78642&patch=iconv.c.patch&revision=1570477956
------------------------------------------------------------------------
[2019-10-07 19:52:14] gedas at martynas dot it
Description:
------------
After upgrading iconv 1.15 -> 1.16 phpinfo() shows iconv version being 1.0.
/usr/local/include/iconv.h snippet:
[...]
23:#define _LIBICONV_VERSION 0x0110 /* version number: (major<<8) + minor */
[...]
And how php parses the version:
285:#if HAVE_LIBICONV
286: {
287: static char buf[16];
288: snprintf(buf, sizeof(buf), "%d.%d",
289: ((_libiconv_version >> 8) & 0x0f), (_libiconv_version &
0x0f));
290: version = buf;
291: }
Till the 1.15 was all fine, as the version string was: 0x010F, after it went to 0x0110, the minor
version became 0 due to the "_libiconv_version & 0x0f".
Suggested change:
#if HAVE_LIBICONV
{
static char buf[16];
snprintf(buf, sizeof(buf), "%d.%d",
_libiconv_version >> 8, _libiconv_version & 0xff);
version = buf;
}
Attaching suggested patch.
Expected result:
----------------
Expected result iconv version 1.16
Actual result:
--------------
Actual result iconv version 1.0
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=78642&edit=1