|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchesprevent-segfault-with-user-or-pass-over-30chars (last revision 2011-12-13 16:22 UTC by paul dot visco at roswellpark dot org)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-06-15 22:06 UTC] bmherold at gmail dot com
[2012-06-15 22:22 UTC] bmherold at gmail dot com
[2013-06-01 06:59 UTC] ssufficool@php.net
[2013-06-01 06:59 UTC] ssufficool@php.net
-Status: Open
+Status: Closed
[2013-06-01 07:05 UTC] ssufficool@php.net
[2013-06-04 03:40 UTC] ssufficool@php.net
[2013-06-04 05:03 UTC] stas@php.net
[2013-11-17 09:30 UTC] laruence@php.net
[2013-11-17 09:31 UTC] laruence@php.net
[2013-11-17 09:31 UTC] laruence@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 10 12:00:02 2025 UTC |
Description: ------------ LIB: freetds-0.91-1 PHP: php 5.3.8 EXT: pdo_dblib from /ext folder of php 5.3.8 source OS: Fedora 16/Centos 5 I was using pdo_dblib to connect to a MSSQL server db. When the password or username is longer than 30 chars, a segmentation fault occurrs, crashing PHP. It would be ideal to instead throw the catchable error from freetds which is "20042 Name too long for LOGINREC field (severity 2)" The problem is that the code is not checking to make sure dbproc is not NULL before processing the error info further. In the case of the password being longer than 30 chars it is NULL, which then causes the seg fault. Test script: --------------- $db = new PDO("dblib:host=someserver;", "uname", '31charpasswordpasswordpasswordp'); Expected result: ---------------- 20042 Name too long for LOGINREC field (severity 2) Actual result: -------------- segmentation fault OUTPUT FROM gdb: Program received signal SIGSEGV, Segmentation fault. 0x000000390502b0ff in __dcigettext () from /lib64/libc.so.6 (gdb) bt #0 0x000000390502b0ff in __dcigettext () from /lib64/libc.so.6 #1 0x0000003905079b3c in strerror_r () from /lib64/libc.so.6 #2 0x000000390507997e in strerror () from /lib64/libc.so.6 #3 0x00002aaab26a6815 in ?? () from /usr/lib64/libsybdb.so.5 #4 0x00002aaab26a7aa9 in dbgetuserdata () from /usr/lib64/libsybdb.so.5 #5 0x00002aaab3bc2c59 in error_handler (dbproc=0x39051200a9, severity=85066262, dberr=0, oserr=0, dberrstr=0x0, oserrstr=0x5 <Address 0x5 out of bounds>) at /home/ROSWELL/visco/php-5.3.8/ext/pdo_dblib/pdo_dblib.c:98