Current:
nlen = UnsafeNativeMethods.sqlite3_value_bytes(p);
ptr = UnsafeNativeMethods.sqlite3_value_blob(p);
if (bDest == null) return nlen;
Need:
nlen = UnsafeNativeMethods.sqlite3_value_bytes(p);
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_value_blob(p);
Marshal.Copy((IntPtr)(ptr.ToInt64() + nDataOffset), bDest, nStart, nCopied);
}
else nCopied = 0;
<hr /><i>mistachkin added on 2011-07-05 10:18:17 UTC:</i><br />
Fixed in [3e063f371f].
<hr /><i>anonymous added on 2011-07-05 13:55:47 UTC:</i><br />
1)
if (nCopied > 0) {
IntPtr ptr = UnsafeNativeMethods.sqlite3_value_blob(p);
...
2)
ptr.ToInt32() -> ptr.ToInt64()
<hr /><i>mistachkin added on 2011-07-07 02:41:02 UTC:</i><br />
Fixed, see check-in [f09f0e8ea1].
<hr /><i>mistachkin added on 2011-07-07 04:19:24 UTC:</i><br />
Added test case, see check-in [a290d2c1a5].
|