|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-03-04 22:32 UTC] felipe@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 22:00:01 2025 UTC |
Description: ------------ Segfaults appear when using: mysql_pconnect('localhost', 'foo', 'bar', 0); but runs fine when using: mysql_pconnect('localhost', 'foo', 'bar'); The bug is most likely caused by trying to store a 'long' value in an 'int' on the stack. At the beginning of php_mysql_do_connect() in ext/mysql/php_mysql.c there is the following declaration: int client_flags = 0; Later in that function zend_parse_parameters() stores a long at &client_flags, which can also overwrite another variable on the stack. Changing the client_flags to unsigned long (like it is defined in mysql's headers) solved my segfault problem. Reproduce code: --------------- // the user/pass don't have to be valid. mysql_pconnect('localhost', 'foo', 'bar', 0); Expected result: ---------------- No segfault. Actual result: -------------- Segfault. No php/zend error message in logs.