# Bug in interbase.c "invalid BLOB ID"

- Thread: https://externals.io/message/42066
- Original archive: https://news-web.php.net/php.internals/42066
- Started by Benjamin Schwarze on 2008-11-28T05:15:25+00:00
- Messages: 7
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #42066 — Benjamin Schwarze — 2008-11-28T05:15:25+00:00

URL: https://externals.io/message/42066#42066

Hi!

As some 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, there might be a smarter way, but this solution worked for 
me. My system is a Fedora Core 8 64bit.

---

## #42067 — Lukas Kahwe Smith — 2008-11-28T10:33:45+00:00

URL: https://externals.io/message/42066#42067 · In reply to: #42066

> Hi!
>
> As some 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, there might be a smarter way, but this solution worked  
> for me. My system is a Fedora Core 8 64bit.


is there a bug opened for this? if not please open one.
also please add your patch

regards,
Lukas Kahwe Smith
mls@pooteeweet.org

---

## #42071 — Benjamin Schwarze — 2008-11-28T15:56:33+00:00

URL: https://externals.io/message/42066#42071 · In reply to: #42067

There is already a bug report: http://bugs.php.net/42089

My last comment contains the patch.

And sorry for the false title of this thread. In real it is the file 
ibase_blobs.c. :)

---

## #42104 — marius popa — 2008-12-04T16:36:10+00:00

URL: https://externals.io/message/42066#42104 · In reply to: #42071

On Fri, Nov 28, 2008 at 5:56 PM, Benjamin Schwarze
<BenjaminSchwarze@theunknownones.net> wrote:
> There is already a bug report: http://bugs.php.net/42089

I saw that someone commented to the bug , i think he must open an new
one and 42089 should be closed
i will double check to be sure is good to be killed
>
> My last comment contains the patch.
>
> And sorry for the false title of this thread. In real it is the file
> ibase_blobs.c. :)
I tested on my machine (64 bit ubuntu) and  seems ok
TEST 1575/4542 [ext/interbase/tests/004.phpt]^MPASS InterBase: BLOB
test [ext/interbase/tests/004.phpt]

make test for php5.3 got only one
failed test to be fixed
TEST 1577/4542 [ext/interbase/tests/006.phpt]^MFAIL InterBase: binding
(may take a while) [ext/interbase/tests/006.phpt]


>
> --
> 
> 
>
>



-- 
developer flamerobin.org

---

## #42126 — Benjamin Schwarze — 2008-12-06T15:54:06+00:00

URL: https://externals.io/message/42066#42126 · In reply to: #42104

I dont understand your comment clearly.
Have you tested the current official code or my patch?

marius popa schrieb:
> On Fri, Nov 28, 2008 at 5:56 PM, Benjamin Schwarze
> <BenjaminSchwarze@theunknownones.net> wrote:
> > […]
> 
> I saw that someone commented to the bug , i think he must open an new
> one and 42089 should be closed
> i will double check to be sure is good to be killed
> > […]
> I tested on my machine (64 bit ubuntu) and  seems ok
> TEST 1575/4542 [ext/interbase/tests/004.phpt]^MPASS InterBase: BLOB
> test [ext/interbase/tests/004.phpt]
> 
> make test for php5.3 got only one
> failed test to be fixed
> TEST 1577/4542 [ext/interbase/tests/006.phpt]^MFAIL InterBase: binding
> (may take a while) [ext/interbase/tests/006.phpt]

---

## #42224 — marius popa — 2008-12-12T15:23:55+00:00

URL: https://externals.io/message/42066#42224 · In reply to: #42126

On Sat, Dec 6, 2008 at 5:54 PM, Benjamin Schwarze
<BenjaminSchwarze@theunknownones.net> wrote:
> I dont understand your comment clearly.
> Have you tested the current official code or my patch?

I have applied the patch and there was no error with the blob tests

>
> marius popa schrieb:
> > […]
>
> --
> 
> 
>
>



-- 
developer flamerobin.org

---

## #42227 — Benjamin Schwarze — 2008-12-12T20:17:03+00:00

URL: https://externals.io/message/42066#42227 · In reply to: #42224

Last question: Is there something to do for me, or is everything clear 
and i can wait for the next release?

marius popa schrieb:
> On Sat, Dec 6, 2008 at 5:54 PM, Benjamin Schwarze
> <BenjaminSchwarze@theunknownones.net> wrote:
> > […]
> 
> I have applied the patch and there was no error with the blob tests
> 
> > […]
