Christian Wendt wrote:
Dear List,
I have run CodeSonar on a project using lmdb. I have downloaded lmdb-0.9.70.tar.gz. These warnings are a Copy-Paste error and Use of memory after free. I would like to share the details to help find out whether these are real or false positives.
The copy-paste warning is generated by code around lines 8870f in mdb.c. In the first block, csrc-> is used throughout, in the second block cdst-> is used, except in one line:
The code is correct. If either src or dst is a LEAF2 page, both of them will be, so it makes no difference which page is checked. The code uses csrc in both places because it will likely already be in the CPU cache the second time.