Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal Buffer of ConvertingString not initialised [ODBC157] #152

Closed
firebird-automations opened this issue Dec 14, 2012 · 3 comments
Closed

Comments

@firebird-automations
Copy link

Submitted by: Gerhard Kokerbeck (gerd)

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;

Commits: b54f88f c775bf2

@firebird-automations
Copy link
Author

Commented by: @alexpotapchenko

Fixed in CVS, thanks

@firebird-automations
Copy link
Author

Modified by: @alexpotapchenko

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 2.0.2 [ 10465 ]

@firebird-automations
Copy link
Author

Modified by: @alexpotapchenko

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants