Bug #10252 Updated: strcat() used on uninitialized string

From: Date: Tue, 17 Apr 2001 03:10:35 +0000
Subject: Bug #10252 Updated: strcat() used on uninitialized string
Groups: php.dev 
Request: Send a blank email to php-dev+get-51756@lists.php.net to get a copy of this message
ID: 10252 Updated by: kalowsky Reported By: dzoll@nyscul.org Old-Status: Open Status: Analyzed Bug Type: ODBC related PHP Version: 4.0.4pl1 Assigned To: Comments: Joey Smith has(had?) a patch he was considering applying that should fix this problem as well... waiting to hear back from him currently on it's status... Previous Comments: --------------------------------------------------------------------------- [2001-04-09 15:30:56] dzoll@nyscul.org I was getting intermittent errors connecting to databases. Sometimes it would work fine, sometimes my connect string would turn to gibberish and sometimes the process would segfault. On further examination, in ext/odbc/php_odbc.c:odbc_sqlconnect(), within the if(strstr(char *)db,";") block, there is a line "strcat(ldb,db);". At this point in the code, ldb was just emalloced, and had uninitialized contents. I think strcpy() is more appopriate here, and changing the code to this seems to have cleared up my errors. Thank you very much. --------------------------------------------------------------------------- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=10252&edit=2

« previous php.dev (#51756) next »