]> git.ipfire.org Git - thirdparty/git.git/commit
coccicheck: detect hashmap_entry.hash assignment
authorEric Wong <e@80x24.org>
Sun, 6 Oct 2019 23:30:25 +0000 (23:30 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 7 Oct 2019 01:20:09 +0000 (10:20 +0900)
commit12878c83516e3b82f31a20f1b5431b7ff607a8db
tree074069d3c740b5745e2bbb3aece81177ad742acf
parente010a41216efd85eacc4c0711ea405de4fb20526
coccicheck: detect hashmap_entry.hash assignment

Assigning hashmap_entry.hash manually leaves hashmap_entry.next
uninitialized, which can be dangerous once the hashmap_entry is
inserted into a hashmap.   Detect those assignments and use
hashmap_entry_init, instead.

Signed-off-by: Eric Wong <e@80x24.org>
Reviewed-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/coccinelle/hashmap.cocci [new file with mode: 0644]