diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2019-09-19 15:02:50 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2019-09-30 10:29:01 +0200 |
commit | df0822688fc3432cf800cdc07c7f9016ea201170 (patch) | |
tree | 78955bb3d433055a3406bd744965901c112b8b7d /crypto | |
parent | 94bd168a9e31d1ab4986e94056dfae71ec5f051f (diff) |
Make default values by ERR_get_error_all() and friends more consistent
Unset data defaults to the empty string ("") or 0.
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9948)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/err/err.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/crypto/err/err.c b/crypto/err/err.c index eca0f6d33e..f46f3bef30 100644 --- a/crypto/err/err.c +++ b/crypto/err/err.c @@ -533,35 +533,30 @@ static unsigned long get_error_values(ERR_GET_ACTION g, es->err_buffer[i] = 0; } - if (file != NULL && line != NULL) { - if (es->err_file[i] == NULL) { - *file = "NA"; - *line = 0; - } else { - *file = es->err_file[i]; - *line = es->err_line[i]; - } + if (file != NULL) { + *file = es->err_file[i]; + if (*file == NULL) + *file = ""; } - + if (line != NULL) + *line = es->err_line[i]; if (func != NULL) { *func = es->err_func[i]; if (*func == NULL) - *func = "N/A"; + *func = ""; } - + if (flags != NULL) + *flags = es->err_data_flags[i]; if (data == NULL) { if (g == EV_POP) { err_clear_data(es, i, 0); } } else { - if (es->err_data[i] == NULL) { + *data = es->err_data[i]; + if (*data == NULL) { *data = ""; if (flags != NULL) *flags = 0; - } else { - *data = es->err_data[i]; - if (flags != NULL) - *flags = es->err_data_flags[i]; } } return ret; |