Issue Details (XML | Word | Printable)

Key: ODBC-157
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Alexander Potapchenko
Reporter: Gerhard Kokerbeck
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
ODBC Driver

internal Buffer of ConvertingString not initialised

Created: 14/Dec/12 01:15 PM   Updated: 09/Jul/13 11:02 AM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0.2

Environment: Windows7


 Description  « Hide
ConvertingString ueses an internal Buffer, aloccated with new, leaving it uninitialised.
If the Buffer is not used the automatic conversion that is done in the dtor of ConvertingString may give unpredictable errors.
Heres a patch to fix this:

--- g:\zw\OdbcFb-Source-2.0.1.152\MainUnicode.cpp 2011-10-11 15:12:18.000000000 +0100
+++ f:\src\odbcfb_src\MainUnicode.cpp 2012-12-13 14:31:16.000000000 +0100
@@ -215,13 +215,16 @@
  void Alloc()
  {
  switch ( isWhy )
  {
  case BYTESCHARS:
  if ( lengthString )
+ {
  byteString = new SQLCHAR[ lengthString + 2 ];
+ memset(byteString,0,lengthString+2);
+ }
  else
  byteString = NULL;
  break;
 
  case NONE:
  unicodeString = NULL;


 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Alexander Potapchenko added a comment - 14/Dec/12 01:51 PM
Fixed in CVS, thanks