diff options
author | Gregor Beck <gbeck@sernet.de> | 2011-10-25 09:33:05 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2012-09-21 16:26:38 +0200 |
commit | fe74b777d2beb6d033b68c271d9c869789cc4ac5 (patch) | |
tree | 21cbb3b1d76878fd5afd63cb483a93aae18ce274 | |
parent | ae037670b83557d8591c633896186a3634de30cc (diff) | |
download | samba-fe74b777d2beb6d033b68c271d9c869789cc4ac5.tar.gz samba-fe74b777d2beb6d033b68c271d9c869789cc4ac5.tar.bz2 samba-fe74b777d2beb6d033b68c271d9c869789cc4ac5.zip |
s3:dbwrap: let dbwrap_fetch_uint32 distinguish between "not found" and "wrong format"
Signed-off-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r-- | lib/dbwrap/dbwrap_util.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/dbwrap/dbwrap_util.c b/lib/dbwrap/dbwrap_util.c index 119c7e1137..d0a34cc906 100644 --- a/lib/dbwrap/dbwrap_util.c +++ b/lib/dbwrap/dbwrap_util.c @@ -112,10 +112,13 @@ NTSTATUS dbwrap_fetch_uint32_bystring(struct db_context *db, return status; } - if ((dbuf.dptr == NULL) || (dbuf.dsize != sizeof(uint32_t))) { - TALLOC_FREE(dbuf.dptr); + if ((dbuf.dptr == NULL) || (dbuf.dsize == 0)) { return NT_STATUS_NOT_FOUND; } + if (dbuf.dsize != sizeof(uint32_t)) { + TALLOC_FREE(dbuf.dptr); + return NT_STATUS_UNSUCCESSFUL; + } *val = IVAL(dbuf.dptr, 0); TALLOC_FREE(dbuf.dptr); |