Page MenuHomePhabricator

[avalanche] Fix a use after out-of-scope in peermanager tests
ClosedPublic

Authored by Fabien on Sep 18 2023, 07:52.

Details

Summary

The issue has been introduced in D14484. The blockhash for the blockindex is built and set from a loop local variable but not reset to some larger scope pointer after the loop exists, causing the fault on the subsequent use of the block hash. It doesn't impact the behavior of the test though, because at this point it checks there is no winner, so any blockhash value will work the same including garbage from freed memory.

Test Plan

With ASAN:

ninja check-avalanche-peermanager_tests

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable