]> git.ipfire.org Git - thirdparty/samba.git/commit
tdbtorture: Fix CID 1034816: proper calloc usage
authorShachar Sharon <ssharon@redhat.com>
Tue, 19 Aug 2025 09:18:28 +0000 (12:18 +0300)
committerGünther Deschner <gd@samba.org>
Tue, 19 Aug 2025 18:08:01 +0000 (18:08 +0000)
commitaffb734a2568a342e443872ae6c789ef03f5faa6
tree23abce064ad3399f8c307c038f4b81b2a9592e0b
parentd4d231dc50f1bbf42ae8cd8fb49f96ae6c4c0ee8
tdbtorture: Fix CID 1034816: proper calloc usage

Standard signature is 'calloc(n_elems, elem_size)', where element size
(in particular, when using 'sizeof') comes as 2nd arg. The actual
allocation size does not care for ordering but swapping the order
confuses static-analysis tools like Coverity, as well as naive readers.

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Shweta Sodani <ssodani@redhat.com>
Reviewed-by: Rabinarayan Panigrahi <rapanigr@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Tue Aug 19 18:08:02 UTC 2025 on atb-devel-224
lib/tdb/tools/tdbtorture.c