]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #30224 (Sybase date strings are sometimes not null
authorIlia Alshanetsky <iliaa@php.net>
Tue, 28 Sep 2004 14:07:59 +0000 (14:07 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 28 Sep 2004 14:07:59 +0000 (14:07 +0000)
terminated).

NEWS
ext/mssql/php_mssql.c

diff --git a/NEWS b/NEWS
index 32b02bca469a9cec0e1804e492d41b685fd57458..9d05674e75ece9bd80bcc1123a85064722db1ec2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,8 @@
 PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? 2004, PHP 5.0.3
+- Fixed bug #30224 (Sybase date strings are sometimes not null terminated).
+  (Ilia)
 - Fixed bug #30147 (OO sqlite_fetch_object did not reset error handler). (Wez)
 - Fixed bug #30133 (get_current_user() crashes on Windows). (Edin)
 - Fixed bug #30057 (did not detect IPV6 on FreeBSD 4.1). (Wez)
index 9930d3d0e4ee8603c588862218b3262b6588b4d6..74a3fe3d1cac5b9fbfc9703f95ebaeb11816030f 100644 (file)
@@ -862,6 +862,7 @@ static void php_mssql_get_column_content_with_type(mssql_link *mssql_ptr,int off
 
                                        res_buf = (unsigned char *) emalloc(res_length+1);
                                        res_length = dbconvert(NULL,coltype(offset),dbdata(mssql_ptr->link,offset), res_length, SQLCHAR,res_buf,-1);
+                                       res_buf[res_length] = '\0';
                                } else {
                                        if (column_type == SQLDATETIM4) {
                                                DBDATETIME temp;
@@ -931,7 +932,7 @@ static void php_mssql_get_column_content_without_type(mssql_link *mssql_ptr,int
                        
                        res_buf = (unsigned char *) emalloc(res_length+1);
                        res_length = dbconvert(NULL,coltype(offset),dbdata(mssql_ptr->link,offset), res_length, SQLCHAR, res_buf, -1);
-
+                       res_buf[res_length] = '\0';
                } else {
                        if (column_type == SQLDATETIM4) {
                                DBDATETIME temp;