diff options
| author | 2001-06-22 00:02:45 +0000 | |
|---|---|---|
| committer | 2001-06-22 00:02:45 +0000 | |
| commit | ce6fc0900b2b4e5edea1b1b8e032cab822e464e9 (patch) | |
| tree | b11b933beb98ff4d5fb927f3ad0fdef1f485128d /lib/libcrypto/err/err.c | |
| parent | Build and install Heimdal infofile. (diff) | |
| download | wireguard-openbsd-ce6fc0900b2b4e5edea1b1b8e032cab822e464e9.tar.xz wireguard-openbsd-ce6fc0900b2b4e5edea1b1b8e032cab822e464e9.zip | |
openssl-engine-0.9.6a merge
Diffstat (limited to 'lib/libcrypto/err/err.c')
| -rw-r--r-- | lib/libcrypto/err/err.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/libcrypto/err/err.c b/lib/libcrypto/err/err.c index 99272e437c7..839f4ab81ac 100644 --- a/lib/libcrypto/err/err.c +++ b/lib/libcrypto/err/err.c @@ -389,20 +389,18 @@ void ERR_put_error(int lib, int func, int reason, const char *file, void ERR_clear_error(void) { + int i; ERR_STATE *es; es=ERR_get_state(); -#if 0 - /* hmm... is this needed */ for (i=0; i<ERR_NUM_ERRORS; i++) { es->err_buffer[i]=0; + err_clear_data(es,i); es->err_file[i]=NULL; es->err_line[i]= -1; - err_clear_data(es,i); } -#endif es->top=es->bottom=0; } @@ -464,7 +462,14 @@ static unsigned long get_error_values(int inc, const char **file, int *line, } } - if (data != NULL) + if (data == NULL) + { + if (inc) + { + err_clear_data(es, i); + } + } + else { if (es->err_data[i] == NULL) { @@ -749,8 +754,9 @@ void ERR_set_error_data(char *data, int flags) if (i == 0) i=ERR_NUM_ERRORS-1; + err_clear_data(es,i); es->err_data[i]=data; - es->err_data_flags[es->top]=flags; + es->err_data_flags[i]=flags; } void ERR_add_error_data(int num, ...) @@ -759,7 +765,7 @@ void ERR_add_error_data(int num, ...) int i,n,s; char *str,*p,*a; - s=64; + s=80; str=OPENSSL_malloc(s+1); if (str == NULL) return; str[0]='\0'; |
