php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33080 Bug 31465 recurring on 5.0.4
Submitted: 2005-05-20 15:07 UTC Modified: 2005-05-27 04:03 UTC
From: marc at durdin dot net Assigned: iliaa (profile)
Status: Closed Package: Strings related
PHP Version: 5.0.4 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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: marc at durdin dot net
New email:
PHP Version: OS:

 

 [2005-05-20 15:07 UTC] marc at durdin dot net
Description:
------------
Bug 31465 has been marked as fixed in 5.0.4 - however, I just upgraded to 5.0.4 and started experiencing it on my system - using it to upload files as follows:

I am using the stock precompiled download from php.net.

Basic PHP information:

PHP Version => 5.0.4

System => Windows NT 5.2 build 3790
Build Date => Mar 31 2005 02:44:34
Configure Command => cscript /nologo configure.js  "--enable-snapshot-build" "--with-gd=shared"
Server API => Command Line Interface
Virtual Directory Support => enabled
Configuration File (php.ini) Path => [obscured]
PHP API => 20031224
PHP Extension => 20041030
Zend Extension => 220040412
Debug Build => no
Thread Safety => enabled
IPv6 Support => enabled
Registered PHP Streams => php, file, http, ftp, compress.zlib
Registered Stream Socket Transports => tcp, udp

Marc Durdin

Reproduce code:
---------------
      $datastring = file_get_contents($Filename);
      $data = unpack("H*hex", $datastring);
      $FileID = mssql_db_call_to_store_file($OriginalFileName, '0x'.$data['hex']);


Expected result:
----------------
(no output expected)

Actual result:
--------------
Warning: unpack() function.unpack: Type H: outside of string


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-05-20 16:27 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.


 [2005-05-25 12:54 UTC] marc at durdin dot net
Managed to get a script that will do it every time (seems that it raises a E_WARNING). Again, doesn't generate the warning on 5.0.2, does on 5.0.4.

<?php 
  set_error_handler("err_handler");
  unpack("H*hex", 'abc');

  function err_handler($errno, $errstr, $errfile, $errline, $vars)
  {
    echo $errno . ": " . $errstr;
  }
?>
 [2005-05-26 00:59 UTC] sniper@php.net
Works fine with HEAD, PHP_5_0 buggy..Ilia, you claimed to have fixed this?
 [2005-05-27 04:03 UTC] iliaa@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 13 09:01:28 2024 UTC