diff options
author | beck <> | 2001-06-22 00:03:44 +0000 |
---|---|---|
committer | beck <> | 2001-06-22 00:03:44 +0000 |
commit | 38b6ff9e5294811c57541ad47940f8f8f41dc114 (patch) | |
tree | 402699541cee3cf3f2943b0384dbda7de534de70 /src/lib/libcrypto/err/err.c | |
parent | afae624d63e4e717c5bae8c7842a4712309f728f (diff) | |
download | openbsd-38b6ff9e5294811c57541ad47940f8f8f41dc114.tar.gz openbsd-38b6ff9e5294811c57541ad47940f8f8f41dc114.tar.bz2 openbsd-38b6ff9e5294811c57541ad47940f8f8f41dc114.zip |
openssl-engine-0.9.6a merge
Diffstat (limited to 'src/lib/libcrypto/err/err.c')
-rw-r--r-- | src/lib/libcrypto/err/err.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/lib/libcrypto/err/err.c b/src/lib/libcrypto/err/err.c index 99272e437c..839f4ab81a 100644 --- a/src/lib/libcrypto/err/err.c +++ b/src/lib/libcrypto/err/err.c | |||
@@ -389,20 +389,18 @@ void ERR_put_error(int lib, int func, int reason, const char *file, | |||
389 | 389 | ||
390 | void ERR_clear_error(void) | 390 | void ERR_clear_error(void) |
391 | { | 391 | { |
392 | int i; | ||
392 | ERR_STATE *es; | 393 | ERR_STATE *es; |
393 | 394 | ||
394 | es=ERR_get_state(); | 395 | es=ERR_get_state(); |
395 | 396 | ||
396 | #if 0 | ||
397 | /* hmm... is this needed */ | ||
398 | for (i=0; i<ERR_NUM_ERRORS; i++) | 397 | for (i=0; i<ERR_NUM_ERRORS; i++) |
399 | { | 398 | { |
400 | es->err_buffer[i]=0; | 399 | es->err_buffer[i]=0; |
400 | err_clear_data(es,i); | ||
401 | es->err_file[i]=NULL; | 401 | es->err_file[i]=NULL; |
402 | es->err_line[i]= -1; | 402 | es->err_line[i]= -1; |
403 | err_clear_data(es,i); | ||
404 | } | 403 | } |
405 | #endif | ||
406 | es->top=es->bottom=0; | 404 | es->top=es->bottom=0; |
407 | } | 405 | } |
408 | 406 | ||
@@ -464,7 +462,14 @@ static unsigned long get_error_values(int inc, const char **file, int *line, | |||
464 | } | 462 | } |
465 | } | 463 | } |
466 | 464 | ||
467 | if (data != NULL) | 465 | if (data == NULL) |
466 | { | ||
467 | if (inc) | ||
468 | { | ||
469 | err_clear_data(es, i); | ||
470 | } | ||
471 | } | ||
472 | else | ||
468 | { | 473 | { |
469 | if (es->err_data[i] == NULL) | 474 | if (es->err_data[i] == NULL) |
470 | { | 475 | { |
@@ -749,8 +754,9 @@ void ERR_set_error_data(char *data, int flags) | |||
749 | if (i == 0) | 754 | if (i == 0) |
750 | i=ERR_NUM_ERRORS-1; | 755 | i=ERR_NUM_ERRORS-1; |
751 | 756 | ||
757 | err_clear_data(es,i); | ||
752 | es->err_data[i]=data; | 758 | es->err_data[i]=data; |
753 | es->err_data_flags[es->top]=flags; | 759 | es->err_data_flags[i]=flags; |
754 | } | 760 | } |
755 | 761 | ||
756 | void ERR_add_error_data(int num, ...) | 762 | void ERR_add_error_data(int num, ...) |
@@ -759,7 +765,7 @@ void ERR_add_error_data(int num, ...) | |||
759 | int i,n,s; | 765 | int i,n,s; |
760 | char *str,*p,*a; | 766 | char *str,*p,*a; |
761 | 767 | ||
762 | s=64; | 768 | s=80; |
763 | str=OPENSSL_malloc(s+1); | 769 | str=OPENSSL_malloc(s+1); |
764 | if (str == NULL) return; | 770 | if (str == NULL) return; |
765 | str[0]='\0'; | 771 | str[0]='\0'; |