]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib:util: Check return value of tdb_parse_record()
authorAndreas Schneider <asn@samba.org>
Fri, 10 Dec 2021 14:06:03 +0000 (15:06 +0100)
committerJeremy Allison <jra@samba.org>
Wed, 15 Dec 2021 19:32:30 +0000 (19:32 +0000)
This makes covscan happy.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/util/util_tdb.c

index b00b5039ec19091a21e093f0b522dc4c8d3fe931..d8672c35b9abf5e9bfc302a04190a02e2777af24 100644 (file)
@@ -142,8 +142,11 @@ static int fetch_int32_parser(TDB_DATA key, TDB_DATA data, void *private_data)
 
 static int32_t tdb_fetch_int32_byblob(struct tdb_context *tdb, TDB_DATA key)
 {
-       int v = -1;
-       tdb_parse_record(tdb, key, fetch_int32_parser, &v);
+       int32_t v = -1;
+       int32_t ret = tdb_parse_record(tdb, key, fetch_int32_parser, &v);
+       if (ret == -1) {
+               return ret;
+       }
        return v;
 }