From 97760104c0fd311206b88aecd91fa1f59fe2b85a Mon Sep 17 00:00:00 2001 From: Kris Zyp Date: Sat, 12 Mar 2022 07:19:20 -0700 Subject: [PATCH] Perform argument check for putString --- src/txn.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/txn.cpp b/src/txn.cpp index 081f4d949e..59acdffdcc 100644 --- a/src/txn.cpp +++ b/src/txn.cpp @@ -295,6 +295,8 @@ Nan::NAN_METHOD_RETURN_TYPE TxnWrap::putCommon(Nan::NAN_METHOD_ARGS_TYPE info, v } NAN_METHOD(TxnWrap::putString) { + if (!info[2]->IsString()) + return Nan::ThrowError("Value must be a string."); return putCommon(info, [](Nan::NAN_METHOD_ARGS_TYPE info, MDB_val &data) -> void { CustomExternalStringResource::writeTo(Local::Cast(info[2]), &data); }, [](MDB_val &data) -> void {