Bug in interbase.c (Ver. 5.2.6) INVALID BLOB ID

Hi!

Ay many other users recognized, there is a bug in the implementation of
the function "_php_ibase_quad_to_string". (imho since version 5.2.1)

The line "spprintf(&result, BLOB_ID_LEN+1, "0x%0*" LL_MASK "x", 16,
*(ISC_UINT64*)(void *) &qd);" doesnt work as estimated. The result
stored inside qd isnt the value convertet from the string, but something
else. Normally this should work, but it doesnt.

One possible solution is, to change the line into "spprintf(&result,
BLOB_ID_LEN+1, "0x%0*x%0*x", 8, qd.gds_quad_low, 8, qd.gds_quad_high);"

Of course, this solution isnt the fine way ... but it works.

The problem occured onto a 64bit System (Fedora Core 8).

Greetings
Benjamin

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Benjamin Schwarze [ Do, 27 November 2008 10:54 ] [ ID #1978897 ]

Re: Bug in interbase.c (Ver. 5.2.6) INVALID BLOB ID

Benjamin Schwarze wrote:
> Hi!
>
> Ay many other users recognized, there is a bug in the implementation of
> the function "_php_ibase_quad_to_string". (imho since version 5.2.1)
>
> The line "spprintf(&result, BLOB_ID_LEN+1, "0x%0*" LL_MASK "x", 16,
> *(ISC_UINT64*)(void *) &qd);" doesnt work as estimated. The result
> stored inside qd isnt the value convertet from the string, but something
> else. Normally this should work, but it doesnt.
>
> One possible solution is, to change the line into "spprintf(&result,
> BLOB_ID_LEN+1, "0x%0*x%0*x", 8, qd.gds_quad_low, 8, qd.gds_quad_high);"
>
> Of course, this solution isnt the fine way ... but it works.

If you want to discuss this sort of stuff, join the -internals list.
That's where they discuss the C code behind php.

--
Postgresql & php tutorials
http://www.designmagick.com/


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
dmagick [ Do, 27 November 2008 23:25 ] [ ID #1978905 ]

Re: Bug in interbase.c (Ver. 5.2.6) INVALID BLOB ID

Thank you for this hint.

Chris schrieb:
> Benjamin Schwarze wrote:
>> Hi!
>>
>> Ay many other users recognized, there is a bug in the implementation
>> of the function "_php_ibase_quad_to_string". (imho since version 5.2.1)
>>
>> The line "spprintf(&result, BLOB_ID_LEN+1, "0x%0*" LL_MASK "x", 16,
>> *(ISC_UINT64*)(void *) &qd);" doesnt work as estimated. The result
>> stored inside qd isnt the value convertet from the string, but
>> something else. Normally this should work, but it doesnt.
>>
>> One possible solution is, to change the line into "spprintf(&result,
>> BLOB_ID_LEN+1, "0x%0*x%0*x", 8, qd.gds_quad_low, 8, qd.gds_quad_high);"
>>
>> Of course, this solution isnt the fine way ... but it works.
>
> If you want to discuss this sort of stuff, join the -internals list.
> That's where they discuss the C code behind php.
>

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Benjamin Schwarze [ Fr, 28 November 2008 06:11 ] [ ID #1979018 ]
PHP » gmane.comp.php.database » Bug in interbase.c (Ver. 5.2.6) INVALID BLOB ID

Vorheriges Thema: Re: Help to create multiple referrals using php and mysql
Nächstes Thema: Unable to Login to Oracle 9i-R2 Database Using PHP 5.2.5