summaryrefslogtreecommitdiff
path: root/lib/dbwrap
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2014-01-27 17:34:31 +0100
committerStefan Metzmacher <metze@samba.org>2014-02-07 16:06:07 +0100
commitc7961ee4953dbcc8c45790d3c92fe3172e924f47 (patch)
treea6edc71b553e6c55034001eaca268cbab49409b6 /lib/dbwrap
parent99140170a587102493e9f073145ba941987d01d3 (diff)
downloadsamba-c7961ee4953dbcc8c45790d3c92fe3172e924f47.tar.gz
dbwrap: completely check validity of lock order in dbwrap_check_lock_order()
This is currently not strictly necessay, because the only caller catches the DBWRAP_LOCK_ORDER_NONE case, and maximum is already checked, but this seems too dangerous to me. Use the new DBWRAP_LOCK_ORDER_VALID() macro. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'lib/dbwrap')
-rw-r--r--lib/dbwrap/dbwrap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/dbwrap/dbwrap.c b/lib/dbwrap/dbwrap.c
index 3606617e2e8..d75c714ef1f 100644
--- a/lib/dbwrap/dbwrap.c
+++ b/lib/dbwrap/dbwrap.c
@@ -167,7 +167,7 @@ static struct dbwrap_lock_order_state *dbwrap_check_lock_order(
static struct db_context *locked_dbs[DBWRAP_LOCK_ORDER_MAX];
struct dbwrap_lock_order_state *state = NULL;
- if (db->lock_order > DBWRAP_LOCK_ORDER_MAX) {
+ if (!DBWRAP_LOCK_ORDER_VALID(db->lock_order)) {
DEBUG(0,("Invalid lock order %d of %s\n",
(int)db->lock_order, db->name));
smb_panic("invalid lock_order\n");