php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2664 default conversion of sybase data types to SYBCHAR return extranious chars
Submitted: 1999-11-04 15:26 UTC Modified: 1999-11-05 03:58 UTC
From: neal at wanlink dot com Assigned:
Status: Closed Package: Sybase (dblib) related
PHP Version: 3.0.12 OS: Solaris
Private report: No CVE-ID: None
 [1999-11-04 15:26 UTC] neal at wanlink dot com
This problem has existed since at least 3.0.5 that I'm aware of, and I finally got tired of seeing it.... Any sybase data type that is not explicitly handled (ei. SYBINT(2,4) SYBCHAR, SYBTEXT, SYBREAL) is implicitly converted to SYBCHAR by calling dbconvert, and returns not only the converted data, but un-initialized extranious data for the length the the field as it is stored in sybase. A simple call to memset just before the dbconvert call seems to cure this anoying little creepy crawly... :)

This fix may apply to, and close the following bugs (I did little research on these bugid's so YMMV);
	863,889,941,894,1112,1338,1376

*** sybase.c.orig       Thu Nov  4 13:14:05 1999
--- sybase.c    Thu Nov  4 12:39:04 1999
***************
*** 662,667 ****
--- 662,668 ----
                                }

                                res_buf = (char *) emalloc(res_length+1);
+                               memset(res_buf,' ',res_length+1);
                                dbconvert(NULL,coltype(offset),dbdata(sybase_ptr->link,offset), res_length,SYBCHAR,res_buf,-1);

                                /* get rid of trailing spaces */

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-11-05 03:58 UTC] thies at cvs dot php dot net
thanx for the patch - fixed in CVS
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 08 19:01:27 2024 UTC