lib/base: heim_config_parse_debug initialize output parameters

The caller of heim_config_parse_debug() expects the output
parameters to be initialized even when the return code is non-zero.
This change initializes the output parameters in case the caller
did not.  Not all code paths assign values to the output parameters
which can result in unexpected termination of the process when
an uninitialized stack pointer is assumed to be valid.

Change-Id: Ib7530a9f16ba3e1500a7e27ccdd8ad9f0492b464
This commit is contained in:
Jeffrey Altman
2020-05-25 17:30:41 -04:00
committed by Nicolas Williams
parent fde95037a8
commit 728639e817

View File

@@ -392,6 +392,9 @@ heim_config_parse_debug(struct fileptr *f,
char buf[2048];
heim_error_code ret;
*lineno = 0;
*err_message = "";
while (config_fgets(buf, sizeof(buf), f) != NULL) {
char *p;