php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7117 ibase_query() crashes when inserting a blob_id
Submitted: 2000-10-10 08:30 UTC Modified: 2000-10-17 18:58 UTC
From: lb at knuut dot de Assigned: jah (profile)
Status: Closed Package: InterBase related
PHP Version: 4.0.3RC2 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: lb at knuut dot de
New email:
PHP Version: OS:

 

 [2000-10-10 08:30 UTC] lb at knuut dot de
this little script crashes php4.02 and 4.03dev on my linux box
no matter if php is running as an apache module or as cgi.

It seems that the error is not in the ibase_blob_import(),
but in the ibase_query() when trying to insert a blob id.

<?php

$dbhandle = ibase_connect("/tmp/test.gdb", "itsme", "secret");
ibase_query($dbhandle, "create table test (bid integer, bbb blob)");
ibase_commit();
$bfhandle = fopen("/tmp/test.txt", "r");
$b_str = ibase_blob_import($dbhandle, $bfhandle);
ibase_query("insert into test (bid, bbb) values (1, ?)", $b_str);

?>


I hope this will help to fix this nasty bug:

(gdb) bt
#0  0x8098c45 in _efree (ptr=0x8175204) at zend_alloc.c:217
#1  0x80b880d in _php_ibase_free_xsqlda (sqlda=0x81dafbc) at interbase.c:297
#2  0x80ba98d in _php_ibase_exec (ib_resultp=0xbfffe604, ib_query=0x81daebc, argc=1,
    args=0x81a1680) at interbase.c:1413
#3  0x80bb069 in php_if_ibase_query (ht=2, return_value=0x81ab9cc, this_ptr=0x0,
    return_value_used=0) at interbase.c:1677
#4  0x80937d8 in execute (op_array=0x81ac60c) at ./zend_execute.c:1519
#5  0x8089e92 in zend_execute_scripts (type=8, file_count=3) at zend.c:717
#6  0x8064b6b in php_execute_script (primary_file=0xbffffac4) at main.c:1199
#7  0x806152c in main (argc=3, argv=0xbffffb24) at cgi_main.c:706


Thanks,
              Lutz

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-10-17 13:48 UTC] jah@php.net
This is hopefully fixed in CVS. Please replace ext/interbase/interbase.c with
http://cvs.php.net/viewcvs.cgi/~checkout~/php4/ext/interbase/interbase.c?rev=1.45
and recompile. And please also tell whether it worked or not...
 [2000-10-17 17:42 UTC] lb at knuut dot de
Thank you Jouni,

my example do not make troubles anymore.

I also did some quick testings with prepare/execute and everything
runs well.

Lutz

 [2000-10-17 18:58 UTC] jah@php.net
No reason to thank. Guess who broke it in the first place? :(

Closing, it is fixed now.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Mar 01 07:01:23 2021 UTC