Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#4 integer problem 64 bit machine

closed
nobody
None
5
2006-02-28
2005-05-25
No

With 64 bit machine php use integer with 64 bit, the
code is not build correct for these condition,
here the patch for the code:
You must check if the value go over the 32bit integert
( value 4294967294 ) and put -2 like done automatically
in 32 bits machine

source oleread.inc

function GetInt4d($data, $pos) {
$value =ord($data[$pos]) | (ord($data[$pos+1])
<< 8) | (ord($data[$pos+2]) << 16) |
(ord($data[$pos+3]) << 24);
if ($value>=4294967294)
{
$value=-2;
}
return $value;
}

source reader.php:

function _GetInt4d($data, $pos) {
$value =ord($data[$pos]) |
(ord($data[$pos+1]) << 8) | (ord($data[$pos+2]) << 16)
| (ord($data[$pos+3]) << 24);
if ($value>=4294967294)
{
$value=-2;
}
return $value;
}

Discussion

  • Logged In: NO

    I can confirm that this is a bug! Please submit patch...but
    hardcoding -2 seems a bit inflexible. Not actually sure
    what this undocumented function is supposed to do?

     
  • Philip Hayden
    Philip Hayden
    2006-02-24

    Logged In: YES
    user_id=1460203

    THANK YOU SO MUCH, I WOULD HAVE NEVER FIGURED THAT OUT. MY
    WEB SERVER CRASHED AND WHEN I MOVED IT TO A NEW SERVER I
    STARTED RECEIVING THIS ERROR, AND LUCKILY YOU POSTED A FIX
    FOR IT. MAYBE WE CAN LOOK TO RELEASE A 64-BIT VERSION OF
    THIS SCRIPT FOR PEOPLE.

    THANKS AGAIN,
    PHILIP

     
  • Travis Harris
    Travis Harris
    2006-02-28

    • status: open --> closed
     
  • Travis Harris
    Travis Harris
    2006-02-28

    Logged In: YES
    user_id=670421

    Patch tested and applied to SVN. Thank you Roberto
    Innocenti - robyinno