pmatilai commented on this pull request.
> + if (meta[4] < 8 || meta[4] > 10) {
+ fprintf(stderr, "unsupported hash version %d\n", meta[4]);
+ bdb_close(db);
+ return 0;
+ }
+ db->maxbucket = meta[18];
+ db->highmask = meta[19];
+ db->lowmask = meta[20];
+ for (i = 0; i < 32; i++)
+ db->spares[i] = meta[24 + i];
+ }
+ if (db->type == BDB_BTREE) {
+ if (meta[4] < 9 || meta[4] > 10) {
+ fprintf(stderr, "unsupported btree version %d\n", meta[4]);
+ bdb_close(db);
+ return 0;
All these early returns should be NULLs, not zeros as the function returns a
pointer.
I'd also prefer the using the "goto err" idiom to minimize the number of exit
points from the function.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/980#pullrequestreview-339714278
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint