From:             [EMAIL PROTECTED]
Operating system: Linux
PHP version:      4CVS-2004-04-20 (stable)
PHP Bug Type:     MSSQL related
Bug description:  mssql_connect segfaults with wrong parameters

Description:
------------
Similar to bug #11490.

mssql_connect (and mssql_pconnect) segfault when called witout the
user/password parameters.

Using PHP CVS Snap from today, FreeTDS v 0.53-7 (Debian Unstable).

Reproduce code:
---------------
echo "Connected: ". ( mssql_pconnect("some_instance") ? 'yes' : 'no' )
."\n";

Expected result:
----------------
No Segfault, uses the interfaces/freetds.conf file for user/pass info.

Actual result:
--------------
Warning: mssql_pconnect(): Login failed for user '(null)'. Reason: Not
associated with a trusted SQL Server connection. (severity 14) in
mssql_test2.php on line 3
Segmentation fault


(gdb) bt
#0  0x402785f3 in tds_reset_msg_info () from /usr/lib/libsybdb.so.1
#1  0x4027470d in dblib_handle_err_message () from /usr/lib/libsybdb.so.1
#2  0x4027852e in tds_process_column_row () from /usr/lib/libsybdb.so.1
#3  0x4027697f in tds_process_default_tokens () from
/usr/lib/libsybdb.so.1
#4  0x40276b5d in tds_process_login_tokens () from /usr/lib/libsybdb.so.1
#5  0x40279c6c in tds_connect () from /usr/lib/libsybdb.so.1
#6  0x40271e33 in tdsdbopen () from /usr/lib/libsybdb.so.1
#7  0x40264e9f in php_mssql_do_connect (ht=1, return_value=0x8196db4,
this_ptr=0x0, return_value_used=1, persistent=1)
    at /home/sean/php4-STABLE-200404122030/ext/mssql/php_mssql.c:501
#8  0x40265491 in zif_mssql_pconnect (ht=1, return_value=0x8196db4,
this_ptr=0x0, return_value_used=1)
    at /home/sean/php4-STABLE-200404122030/ext/mssql/php_mssql.c:684
#9  0x0811f1fa in execute (op_array=0x8199c44) at
/home/sean/php/stable/Zend/zend_execute.c:1637
#10 0x0810fc28 in zend_execute_scripts (type=8, retval=0x0, file_count=3)
at /home/sean/php/stable/Zend/zend.c:886
#11 0x080ed383 in php_execute_script (primary_file=0xbffffca8) at
/home/sean/php/stable/main/main.c:1731
#12 0x08125cac in main (argc=4, argv=0xbffffd24) at
/home/sean/php/stable/sapi/cli/php_cli.c:822


-- 
Edit bug report at http://bugs.php.net/?id=28081&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=28081&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=28081&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=28081&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=28081&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=28081&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=28081&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=28081&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=28081&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=28081&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=28081&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=28081&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=28081&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28081&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=28081&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=28081&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=28081&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28081&r=float

Reply via email to