1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

s3:dbwrap: let dbwrap_fetch_uint32 distinguish between "not found" and "wrong format"

Signed-off-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
Gregor Beck 2011-10-25 09:33:05 +02:00 committed by Stefan Metzmacher
parent ae037670b8
commit fe74b777d2

View File

@ -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);