mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Do not change the OP_String8 opcode into OP_String until *after* any necessary
encoding conversions are accomplished. Otherwise, a rerun of the prepared statement after an OOM can result in errors. Test case in TH3. FossilOrigin-Name: 8efd62594eae725decb719aa7777c020f982b7cdc2c92bab3b91bf349a5bc298
This commit is contained in:
@@ -1143,7 +1143,6 @@ case OP_Real: { /* same as TK_FLOAT, out2 */
|
||||
case OP_String8: { /* same as TK_STRING, out2 */
|
||||
assert( pOp->p4.z!=0 );
|
||||
pOut = out2Prerelease(p, pOp);
|
||||
pOp->opcode = OP_String;
|
||||
pOp->p1 = sqlite3Strlen30(pOp->p4.z);
|
||||
|
||||
#ifndef SQLITE_OMIT_UTF16
|
||||
@@ -1167,6 +1166,7 @@ case OP_String8: { /* same as TK_STRING, out2 */
|
||||
if( pOp->p1>db->aLimit[SQLITE_LIMIT_LENGTH] ){
|
||||
goto too_big;
|
||||
}
|
||||
pOp->opcode = OP_String;
|
||||
assert( rc==SQLITE_OK );
|
||||
/* Fall through to the next case, OP_String */
|
||||
}
|
||||
|
Reference in New Issue
Block a user