Bug #78642 [Opn->Ana]: Wrong version displayed

From: Date: Tue, 08 Oct 2019 08:45:52 +0000
Subject: Bug #78642 [Opn->Ana]: Wrong version displayed
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-223130@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: Open +Status: Analyzed Type: Bug Package: ICONV related Operating System: CentOS 7 PHP Version: 7.2.23 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: Thanks for reporting and the patch! Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#223130) next »