Reported indirectly via MK_UBSAN:
lib/libc/stdlib/getenv.c:169:20: runtime error: load of value 190, which is not a valid value for type 'bool'
MFC after: 3 days
Differential D31382
lib/libc: Fix uninitialized value in __setenv() arichardson on Aug 2 2021, 2:42 PM. Authored by Tags None Referenced Files
Details
Diff Detail
Event TimelineComment Actions If I understand correctly, the envVars with the putenv can't be reused. Comment Actions Well ubsan is complaining that it loaded a value of 190 so that memory clearly wasn't zeroed. Comment Actions I have some reservation with the proposed change. Basically the existing code is assuming that unused environment slots are zeroed (and they should be), so if I was you I'd probably amend the code around the two reallocarray's by zeroing out the newly added memory instead. Comment Actions Oh. Right.
|