Skip to content
Browse files

Issue 278: Pad str read buffer for driver bug.

I'm pretty sure the driver is writing a NULL terminator when it shouldn't, so I've added 2
bytes to allow for a UCS2 terminator.
  • Loading branch information...
1 parent 734f261 commit a0bab2c558586a90c6e0953876347fb5b24b5531 @mkleehammer committed Aug 16, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/getdata.cpp
View
4 src/getdata.cpp
@@ -327,8 +327,8 @@ static PyObject* GetDataString(Cursor* cur, Py_ssize_t iCol)
break;
}
- char tempBuffer[1024];
- DataBuffer buffer(nTargetType, tempBuffer, sizeof(tempBuffer));
+ char tempBuffer[1026]; // Pad with 2 bytes for driver bugs
+ DataBuffer buffer(nTargetType, tempBuffer, sizeof(tempBuffer)-2);
for (int iDbg = 0; iDbg < 10; iDbg++) // failsafe
{

0 comments on commit a0bab2c

Please sign in to comment.
Something went wrong with that request. Please try again.