current:
<pre>
nlen = UnsafeNativeMethods.sqlite3_column_bytes(stmt._sqlite_stmt, index);
ptr = UnsafeNativeMethods.sqlite3_column_blob(stmt._sqlite_stmt, index);
if (bDest == null) return nlen;
</pre>
need:
<pre>
nlen = UnsafeNativeMethods.sqlite3_column_bytes(stmt._sqlite_stmt, index);
if (bDest == null) return nlen;
if (nCopied + nStart > bDest.Length) nCopied = bDest.Length - nStart;
if (nCopied + nDataOffset > nlen) nCopied = nlen - nDataOffset;
if (nCopied > 0) {
ptr = UnsafeNativeMethods.sqlite3_column_blob(stmt._sqlite_stmt, index);
Marshal.Copy((IntPtr)(ptr.ToInt64() + nDataOffset), bDest, nStart, nCopied);
} else nCopied = 0;
</pre>
<hr /><i>shane added on 2011-05-24 01:40:06 UTC:</i><br />
Fixed by [a97d149d1e].
<hr /><i>mistachkin added on 2011-07-07 04:48:39 UTC:</i><br />
Related to [201128cc88].
|