wankdanker/node-odbc — pull request #2 by theduderog (2013-09-03 17:40:51+00:00)
Title: Improper check of return codes in ODBC::GetColumnValue leads to infinite malloc loop 

ODBC::GetColumnValue is not prepared for return codes SQL_ERROR and SQL_INVALID_HANDLE and goes into an infinite loop allowing memory when either of those is returned.

Here's a test script that will cause it to happen.
https://gist.github.com/theduderog/6426954

I'm working on Ubuntu 12.10, node 0.10.15, unixodbc 2.2.14, and libsqlliteodbc 0.91-3.

If I compile node-odbc with DEBUG enabled and UNICODE off, things work ok until I see calls to

ODBC::~ODBC
ODBC::Free
ODBCConnection::~ODBCConnection
ODBCConnection::Free

From then on, all calls return SQL_INVALID_HANDLE