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

index 9f8dd183b34e3af622de54346cf3b28a53f5c704..c0d20b3845fd2a81f37d317e11d6766596905f04 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;