|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78642 Wrong version displayed
Submitted: 2019-10-07 19:52 UTC Modified: 2019-10-08 08:45 UTC
From: gedas at martynas dot it Assigned: cmb (profile)
Status: Closed Package: ICONV related
PHP Version: 7.2.23 OS: CentOS 7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: gedas at martynas dot it
New email:
PHP Version: OS:


 [2019-10-07 19:52 UTC] gedas at martynas dot it
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:
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:
                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


iconv.c.patch (last revision 2019-10-07 19:52 UTC by gedas at martynas dot it)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-10-07 19:52 UTC] gedas at martynas dot it
The following patch has been added/updated:

Patch Name: iconv.c.patch
Revision:   1570477956
 [2019-10-08 08:45 UTC]
-Status: Open +Status: Analyzed -Assigned To: +Assigned To: cmb
 [2019-10-08 08:45 UTC]
Thanks for reporting and the patch!
 [2019-10-08 10:12 UTC]
Automatic comment on behalf of
Log: Fix #78642: Wrong libiconv version displayed
 [2019-10-08 10:12 UTC]
-Status: Analyzed +Status: Closed
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Mar 03 17:01:27 2024 UTC