php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30224 Sybase module complains that date strings are not null terminated
Submitted: 2004-09-24 23:18 UTC Modified: 2004-09-28 16:09 UTC
From: tyler at nas dot net Assigned:
Status: Closed Package: Sybase (dblib) related
PHP Version: 4.3.8 OS: Redhat 9
Private report: No CVE-ID: None
 [2004-09-24 23:18 UTC] tyler at nas dot net
Description:
------------
I installed a debug version of 4.3.8 to try to diagnose a different problem and I see many error messages like:

[client 192.168.1.114] PHP Warning:  String is not zero-terminated (Apr 05 2004 12:00AM          \x84\xcc\x8f*ZZZZZZZA) (source: /usr/src/php-4.3.8/Zend/zend_execute_API.c:291) in Unknown on line 0, referer: http://(my-url)
[client 192.168.1.114] PHP Warning:  String is not zero-terminated (Apr 05 2004 12:00AM          \x84\xcc\x8f*ZZZZZZZA) (source: /usr/src/php-4.3.8/Zend/zend_execute_API.c:291) in Unknown on line 0, referer: http://(my-url)

#1: It isn't very helpful to not print the actual page the error is on.  I'm assuming the "Unknown" would be the page, but it's odd that it can print the referrer.

#2: I've tracked it down to a page that retrieves marks from a sybase database on another server.  Those dates that you see in the above are the dates the student took her tests.

#3: These errors only appear in debug mode.

#4: With either the debug or the normal php, when I print the string there are no extraneous characters.

#5: No extraneous characters appeared and no warning appeared in a perl script that pulled and displayed the same information.

#6: My config:
./configure --build=i386-redhat-linux --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var --mandir=/usr/share/man --infodir=/usr/share/info --prefix=/usr --with-config-file-path=/etc --disable-debug --disable-rpath --enable-inline-optimization --with-bz2 --with-exec-dir=/usr/bin --with-freetype-dir=/usr --with-gd --with-gettext --with-gmp --with-iconv --with-jpeg-dir=/usr --with-mm --with-openssl --with-expat-dir=/usr --with-zlib --with-layout=GNU --enable-bcmath --enable-ftp --enable-magic-quotes --enable-safe-mode --enable-sockets --enable-sysvsem --enable-sysvshm --enable-track-vars --enable-trans-sid --enable-wddx --without-oci8 --with-mysql=/usr/local/mysql --with-apxs2=/usr/sbin/apxs --with-curl --with-sybase=/usr/local/freetds --with-mcrypt --enable-debug


Reproduce code:
---------------
$dbsy = startSyb(); // My connection details are hidden here.

$select = "SELECT date_completed ".
          "FROM student_academic";

$handle = $dbsy->prepare($select);
$result = $dbsy->execute($handle, array());

while ($row = $result->fetchRow(DB_FETCHMODE_ASSOC)) {
}


Expected result:
----------------
Nothing, it shouldn't produce any output.

Actual result:
--------------
Many errors messages like these:

Warning: String is not zero-terminated (Apr 05 2004 12:00AM ??�*?�*) (source: /usr/src/php-4.3.8/Zend/zend_execute_API.c:291) in Unknown on line 0

Warning: String is not zero-terminated (Apr 06 2004 12:00AM ??�*?�*ZZZZA) (source: /usr/src/php-4.3.8/Zend/zend_execute_API.c:291) in Unknown on
line 0

Warning: String is not zero-terminated (May 18 2004 12:00AM ??�*?�*ZZZZA) (source: /usr/src/php-4.3.8/Zend/zend_execute_API.c:291) in Unknown on
line 0

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-28 16:09 UTC] iliaa@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 08:01:29 2024 UTC