Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/lua/sqlite Prevent Lua from crashing if clear_bindings()...
details: https://anonhg.NetBSD.org/src/rev/4340f0cb4dbc
branches: trunk
changeset: 999071:4340f0cb4dbc
user: tpaul <tpaul%NetBSD.org@localhost>
date: Thu May 16 12:42:35 2019 +0000
description:
Prevent Lua from crashing if clear_bindings() is called on a statement
that failed to prepare().
ok mbalmer@
diffstat:
lib/lua/sqlite/sqlite.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diffs (21 lines):
diff -r 11d25597cf8f -r 4340f0cb4dbc lib/lua/sqlite/sqlite.c
--- a/lib/lua/sqlite/sqlite.c Thu May 16 10:28:19 2019 +0000
+++ b/lib/lua/sqlite/sqlite.c Thu May 16 12:42:35 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sqlite.c,v 1.9 2017/05/10 07:36:01 mbalmer Exp $ */
+/* $NetBSD: sqlite.c,v 1.10 2019/05/16 12:42:35 tpaul Exp $ */
/*
* Copyright (c) 2011, 2013, 2016, 2017 Marc Balmer <marc%msys.ch@localhost>
@@ -336,7 +336,10 @@
sqlite3_stmt **stmt;
stmt = luaL_checkudata(L, 1, SQLITE_STMT_METATABLE);
- sqlite3_clear_bindings(*stmt);
+ if (*stmt) {
+ sqlite3_clear_bindings(*stmt);
+ *stmt = NULL;
+ }
return 0;
}
- Prev by Date:
[src/trunk]: src/share/misc CE, DLCI, LMI, MGCP, PE, PVC, SVC, VPWS
- Next by Date:
[src/trunk]: src Rename nb{clang,llvm}-tblgen to ${MACHINE_GNU_PLATFORM}-{cla...
- Previous by Thread:
[src/trunk]: src/share/misc CE, DLCI, LMI, MGCP, PE, PVC, SVC, VPWS
- Next by Thread:
[src/trunk]: src Rename nb{clang,llvm}-tblgen to ${MACHINE_GNU_PLATFORM}-{cla...
- Indexes:
Home |
Main Index |
Thread Index |
Old Index