]> 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:09:01 +0000 (14:09 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 28 Sep 2004 14:09:01 +0000 (14:09 +0000)
terminated).

NEWS
ext/mssql/php_mssql.c

diff --git a/NEWS b/NEWS
index 28ee8419aafd3152ee658dbcdf78a8669794f951..37badf8ff32c7855ddd5f275cd9d5288cabdfaf1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@ PHP 4                                                                      NEWS
 ?? ??? 2004, Version 4.3.10
 - Backported Marcus' foreach() speedup patch from PHP 5.x. (Derick)
 - Fixed potential problems with unserializing invalid serialize data. (Marcus)
+- Fixed bug #30224 (Sybase date strings are sometimes not null terminated).
+  (Ilia)
 - Fixed bug #30057 (did not detect IPV6 on FreeBSD 4.1). (Wez)
 - Fixed bug #29805 (HTTP Authentication Issues). (Uwe Schindler)
 - Fixed bug #28325 (Circular references not properly serialised). (Moriyoshi)
index 489c6553286b9e4bc6d0259b8bca9204ef731de6..4b82b5d41c1a2508790d7bea045c37bf6e87bc63 100644 (file)
@@ -866,6 +866,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;
@@ -939,7 +940,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;