#3027 [Opn->Csd]: error_log interpets % as printf formats and chrashes

From: Date: Mon, 30 Sep 2002 22:18:38 +0000
Subject: #3027 [Opn->Csd]: error_log interpets % as printf formats and chrashes
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-20801@lists.php.net to get a copy of this message
ID: 3027 Updated by: hholzgra@php.net Reported By: zot@zotconsulting.com -Status: Open +Status: Closed Bug Type: Reproducible Crash Operating System: Linux, FreeBSD PHP Version: 3.0.12 New Comment: can't reproduce in 4.2.3 apache module, and both 4.2.3 and 3.0.18 cgi binaries produce identical (correct) output Previous Comments: ------------------------------------------------------------------------ [1999-12-22 14:49:30] zot@zotconsulting.com error_log("'%eagle'"); produces in the apache error_log: [Wed Dec 22 11:28:26 1999] [error] '5.318473e-315agle' other printf strings. In a sql statement of length it crashes repeatedly on any query that has a %e %f %g %h %n My guess is error_log is taking from the next set of arguments, the values for %. Thus it is causing a buffer overflow from time to time. though error_log("'%etttt'"); shows the same scientific number as eagle. I have tested this under Redhat 6.0, Apache/1.3.9, PHP 3.0.12. FreeBSd with Apache/1.3.3, PHP 3.0.6, and Redhat 5.1, Red Hat Secure/2.0, PHP3.0.8. a '%%' prints % just fine. I have added a note to the error_log page. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=3027&edit=1

« previous php.bugs (#20801) next »