summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/dbwrap/dbwrap_util.c7
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);