Lift scope of buf[] to make it extend to a potential access via *basename
authorStefan Eßer <se@FreeBSD.org>
Thu, 10 Dec 2020 09:31:05 +0000 (09:31 +0000)
committerStefan Eßer <se@FreeBSD.org>
Thu, 10 Dec 2020 09:31:05 +0000 (09:31 +0000)
commit7483b9e4dcfb4c444f8b5d54117fb6c8c48c20e9
treef452787e6b609646c7109f32f88717779f40a9b7
parentbb24ee2b7e70e85b11962d98710ea3965072b408
Lift scope of buf[] to make it extend to a potential access via *basename

It can be assumed that the contents of the buffer was still allocated and
valid at the point of the out-of-scope access, so there was no security
issue in practice.

Reported by: Coverity Scan CID 1437697
MFC after: 3 days
usr.sbin/crunch/crunchgen/crunched_main.c