Home GnuPG

Make sure the grcy_get_config string is always null-terminated.

Description

Make sure the grcy_get_config string is always null-terminated.

* src/global.c (_gcry_get_config): Append null-terminator to output.

Config string was not being explicitly null-terminated which resulted
garbage output from tests/version with ASAN enabled builds.

  • Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>

Details

Auditors
werner
Provenance
jukiviliAuthored on Jan 31 2021, 3:59 PM
wernerCommitted on Feb 4 2021, 12:49 PM
Parents
rC370e44127287: Add handling for -Og with O-flag munging
Branches
Unknown
Tags
Unknown

Event Timeline

jukivili added inline comments.
/src/global.c
423

Hm.. Actually this needs to closed with if (!what) {...}.

Otherwise tests/version will print: version: gcry_get_config("no-such-item") returned something.

@werner

/src/global.c
423

Right. I was already wondering why you did this in master. I forgot about that test and didn't run a make check.

All concerns with this commit have now been addressed.Feb 14 2021, 7:00 PM