|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9403 a bug in functions/sybase.c kills and httpd child.
Submitted: 2001-02-22 09:35 UTC Modified: 2002-06-16 08:20 UTC
From: coyote at step dot polymtl dot ca Assigned:
Status: Not a bug Package: Sybase (dblib) related
PHP Version: 3.0.17 OS: Linux RedHat 6.2 (x86)
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.
Block user comment
Status: Assign to:
Bug Type:
From: coyote at step dot polymtl dot ca
New email:
PHP Version: OS:


 [2001-02-22 09:35 UTC] coyote at step dot polymtl dot ca

	On apache-1.3.17+mod_ssl (taken from as src.rpm) with
RedHat 6.2 with observed that a lot of our PHP3 scripts would cause an httpd
child to die with a seg fault. This was with both 3.0.17 and 3.0.18. Some of our
scripts would report a warning but most of them would just die in "sybase_connect"
with just 3 arguments. Usually, adding "iso_1" as a 4th argument would solve the
problem. All of these scripts were working fine on php-3.0.9. A dig in the source
showed up uninitalized use of "charset" in sybase.c. We patched sybase.c this way:

--- php-3.0.18.orig/functions/sybase.c  Mon Aug  7 02:09:54 2000
+++ php-3.0.18/functions/sybase.c       Thu Feb 22 14:12:34 2001
@@ -270,7 +270,7 @@
        switch(ARG_COUNT(ht)) {
                case 0: /* defaults */
-                       host=user=passwd=NULL;
+                       host=user=passwd=charset=NULL;
                        hashed_details = (char *) emalloc(hashed_details_length+
@@ -283,7 +283,7 @@
                                host = yyhost->value.str.val;
-                               user=passwd=NULL;
+                               user=passwd=charset=NULL;
                                hashed_details_length = yyhost->value.str.len+6+
                                hashed_details = (char *) emalloc(hashed_details
@@ -299,7 +299,7 @@
                                host = yyhost->value.str.val;
                                user = yyuser->value.str.val;
-                               passwd=NULL;
+                               passwd=charset=NULL;
                                hashed_details_length = yyhost->value.str.len+yy
                                hashed_details = (char *) emalloc(hashed_details
@@ -317,6 +317,7 @@
                                host = yyhost->value.str.val;
                                user = yyuser->value.str.val;
                                passwd = yypasswd->value.str.val;
+                               charset=NULL;
                                hashed_details_length = yyhost->value.str.len+yy
                                hashed_details = (char *) emalloc(hashed_details
>value.str.val,yyuser->value.str.val,yypasswd->value.str.val); /* SAFE */

If you need more information, can you please contact me? Thanks.

Vincent Cojot,


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-16 08:20 UTC]
Thank you for taking the time to report a problem with PHP.
Unfortunately, PHP 3 is no longer supported. Please download
the latest version of PHP 4 from

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jun 18 05:01:31 2024 UTC