php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68536 pack for 64bits integer is broken on bigendian
Submitted: 2014-12-02 07:37 UTC Modified: 2014-12-02 07:40 UTC
From: remi@php.net Assigned: remi
Status: Closed Package: Strings related
PHP Version: 5.6.4RC1 OS: GNU/LInux bigendian
Private report: No CVE-ID:
 [2014-12-02 07:37 UTC] remi@php.net
Description:
------------
Pack doesn't produce correct output for 64bits integer


Test script:
---------------
php -r 'print_r(pack("Q", 0xfffffffffffe));' | hexdump -C


Expected result:
----------------
00000000  00 00 ff ff ff ff ff fe                           |........|
00000008


Actual result:
--------------
00000000  ff ff ff fe 00 00 00 00                           |........|
00000008


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-12-02 07:37 UTC] remi@php.net
-Assigned To: +Assigned To: remi
 [2014-12-02 07:40 UTC] remi@php.net
-Summary: Pack is broken +Summary: pack for 64bits integer is broken on bigendian
 [2014-12-02 07:41 UTC] remi@php.net
Automatic comment on behalf of remi
Revision: http://git.php.net/?p=php-src.git;a=commit;h=6f3714a8fcdd0dd1831f1c165fe723f5cc238769
Log: Fix Bug #68536 Pack for 64bits integer is broken on bigendian.
 [2014-12-02 07:41 UTC] remi@php.net
-Status: Assigned +Status: Closed
 [2014-12-05 07:00 UTC] ab@php.net
Automatic comment on behalf of remi
Revision: http://git.php.net/?p=php-src.git;a=commit;h=6f3714a8fcdd0dd1831f1c165fe723f5cc238769
Log: Fix Bug #68536 Pack for 64bits integer is broken on bigendian.
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Tue Apr 25 08:01:42 2017 UTC