From: Ilia Alshanetsky Date: Tue, 28 Sep 2004 14:09:01 +0000 (+0000) Subject: MFH: Fixed bug #30224 (Sybase date strings are sometimes not null X-Git-Tag: php-4.3.10RC1~69 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=545e42675d05f903c81b31963f5cef5dbb26e226;p=php MFH: Fixed bug #30224 (Sybase date strings are sometimes not null terminated). --- diff --git a/NEWS b/NEWS index 28ee8419aa..37badf8ff3 100644 --- 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) diff --git a/ext/mssql/php_mssql.c b/ext/mssql/php_mssql.c index 489c655328..4b82b5d41c 100644 --- a/ext/mssql/php_mssql.c +++ b/ext/mssql/php_mssql.c @@ -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;