php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75075 unpack with X* causes infinity loop
Submitted: 2017-08-14 16:19 UTC Modified: -
From: erik at datahack dot se Assigned:
Status: Closed Package: Unknown/Other Function
PHP Version: 7.1.8 OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: erik at datahack dot se
New email:
PHP Version: OS:

 

 [2017-08-14 16:19 UTC] erik at datahack dot se
Description:
------------
Using unpack with "X*" causes an infinity loop

Test script:
---------------
<?php

unpack("X*", "");

Expected result:
----------------
I would expect either 

A. * to not be a valid repeater for X
B. cause it to rewind to zero.

Actual result:
--------------
100% CPU usage

Patches

slaven (last revision 2018-10-21 22:17 UTC by batinic107 at gmail dot com)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-08-15 04:36 UTC] laruence@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=d8c80af71e9b43e9adec9e3f57f2732a0ac95d71
Log: Fixed bug #75075 (unpack with X* causes infinity loop)
 [2017-08-15 04:36 UTC] laruence@php.net
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 13:01:28 2024 UTC