From aba032e1763d312c1109c853ded27cf2955098ca Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Mon, 16 May 2022 18:19:08 -0700 Subject: Copy strings when binding to sqlite --- src/javascript/jsc/bindings/sqlite/JSSQLStatement.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/javascript/jsc/bindings/sqlite/JSSQLStatement.cpp b/src/javascript/jsc/bindings/sqlite/JSSQLStatement.cpp index d7cccd771..ceb803b0a 100644 --- a/src/javascript/jsc/bindings/sqlite/JSSQLStatement.cpp +++ b/src/javascript/jsc/bindings/sqlite/JSSQLStatement.cpp @@ -206,15 +206,15 @@ static inline bool rebindValue(JSC::JSGlobalObject* lexicalGlobalObject, sqlite3 } if (roped.is8Bit()) { - CHECK_BIND(sqlite3_bind_text(stmt, i, reinterpret_cast(roped.characters8()), roped.length(), nullptr)); + CHECK_BIND(sqlite3_bind_text(stmt, i, reinterpret_cast(roped.characters8()), roped.length(), SQLITE_TRANSIENT)); } else { - CHECK_BIND(sqlite3_bind_text16(stmt, i, roped.characters16(), roped.length() * 2, nullptr)); + CHECK_BIND(sqlite3_bind_text16(stmt, i, roped.characters16(), roped.length() * 2, SQLITE_TRANSIENT)); } } else if (UNLIKELY(value.isHeapBigInt())) { CHECK_BIND(sqlite3_bind_int64(stmt, i, JSBigInt::toBigInt64(value))); } else if (JSC::JSArrayBufferView* buffer = JSC::jsDynamicCast(value)) { - CHECK_BIND(sqlite3_bind_blob(stmt, i, buffer->vector(), buffer->byteLength(), nullptr)); + CHECK_BIND(sqlite3_bind_blob(stmt, i, buffer->vector(), buffer->byteLength(), SQLITE_TRANSIENT)); } else { throwException(lexicalGlobalObject, scope, createTypeError(lexicalGlobalObject, "Binding expected string, TypedArray, boolean, number, bigint or null"_s)); return false; -- cgit v1.2.3