php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #176 seg fault with odbc_exec and null params
Submitted: 1998-03-15 00:06 UTC Modified: 1998-03-16 03:26 UTC
From: philip at qs dot co dot nz Assigned: kara (profile)
Status: Closed Package: ODBC related
PHP Version: 3.0b6 OS: Linix-ELF 2.0.30
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: philip at qs dot co dot nz
New email:
PHP Version: OS:

 

 [1998-03-15 00:06 UTC] philip at qs dot co dot nz
Related to bug #12.

Using the following code with mysql-odbc driver and php:
  $params[]= "";
  $dbexec = odbc_prepare($dbcon,"use Non-existant-database"); 
  $dbexec = odbc_execute($dbexec,$params);
produces segfault in functions/unified_odbc.c line 700:
	efree(params);

Fix:
      check params not Null before calling efree().
       check line 713 also.
Note:
I am only using prepare/execute because the odbc_exec function
does not work with the mysql driver. I do not have any params to susbstitute in the call but
the function requires a parameter array to be passed.




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-03-16 03:26 UTC] kara
The parameter array in odbc_execute() is optional. It is only used if your prepared
statement has placeholders.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 22:01:29 2024 UTC