diff options
| author | beck <> | 2002-05-21 01:49:11 +0000 |
|---|---|---|
| committer | beck <> | 2002-05-21 01:49:11 +0000 |
| commit | 7ebf0f8371844decf17c65829147760ed09339a6 (patch) | |
| tree | b39f86312e7ebfd4945e393b8949356694ad06fe /src/lib/libcrypto/bio | |
| parent | 2117eaece54016b776476220b41b97441e75b0e0 (diff) | |
| download | openbsd-7ebf0f8371844decf17c65829147760ed09339a6.tar.gz openbsd-7ebf0f8371844decf17c65829147760ed09339a6.tar.bz2 openbsd-7ebf0f8371844decf17c65829147760ed09339a6.zip | |
Merge openssl-0.9.7-stable-SNAP-20020519
Diffstat (limited to 'src/lib/libcrypto/bio')
| -rw-r--r-- | src/lib/libcrypto/bio/b_print.c | 16 | ||||
| -rw-r--r-- | src/lib/libcrypto/bio/bss_bio.c | 13 |
2 files changed, 24 insertions, 5 deletions
diff --git a/src/lib/libcrypto/bio/b_print.c b/src/lib/libcrypto/bio/b_print.c index b7e268f092..3ce1290772 100644 --- a/src/lib/libcrypto/bio/b_print.c +++ b/src/lib/libcrypto/bio/b_print.c | |||
| @@ -56,6 +56,13 @@ | |||
| 56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
| 57 | */ | 57 | */ |
| 58 | 58 | ||
| 59 | /* disable assert() unless BIO_DEBUG has been defined */ | ||
| 60 | #ifndef BIO_DEBUG | ||
| 61 | # ifndef NDEBUG | ||
| 62 | # define NDEBUG | ||
| 63 | # endif | ||
| 64 | #endif | ||
| 65 | |||
| 59 | /* | 66 | /* |
| 60 | * Stolen from tjh's ssl/ssl_trc.c stuff. | 67 | * Stolen from tjh's ssl/ssl_trc.c stuff. |
| 61 | */ | 68 | */ |
| @@ -716,12 +723,13 @@ doapr_outch( | |||
| 716 | if (buffer) { | 723 | if (buffer) { |
| 717 | while (*currlen >= *maxlen) { | 724 | while (*currlen >= *maxlen) { |
| 718 | if (*buffer == NULL) { | 725 | if (*buffer == NULL) { |
| 719 | assert(*sbuffer != NULL); | ||
| 720 | if (*maxlen == 0) | 726 | if (*maxlen == 0) |
| 721 | *maxlen = 1024; | 727 | *maxlen = 1024; |
| 722 | *buffer = OPENSSL_malloc(*maxlen); | 728 | *buffer = OPENSSL_malloc(*maxlen); |
| 723 | if (*currlen > 0) | 729 | if (*currlen > 0) { |
| 730 | assert(*sbuffer != NULL); | ||
| 724 | memcpy(*buffer, *sbuffer, *currlen); | 731 | memcpy(*buffer, *sbuffer, *currlen); |
| 732 | } | ||
| 725 | *sbuffer = NULL; | 733 | *sbuffer = NULL; |
| 726 | } else { | 734 | } else { |
| 727 | *maxlen += 1024; | 735 | *maxlen += 1024; |
| @@ -761,7 +769,9 @@ int BIO_vprintf (BIO *bio, const char *format, va_list args) | |||
| 761 | { | 769 | { |
| 762 | int ret; | 770 | int ret; |
| 763 | size_t retlen; | 771 | size_t retlen; |
| 764 | MS_STATIC char hugebuf[1024*10]; | 772 | char hugebuf[1024*2]; /* Was previously 10k, which is unreasonable |
| 773 | in small-stack environments, like threads | ||
| 774 | or DOS programs. */ | ||
| 765 | char *hugebufp = hugebuf; | 775 | char *hugebufp = hugebuf; |
| 766 | size_t hugebufsize = sizeof(hugebuf); | 776 | size_t hugebufsize = sizeof(hugebuf); |
| 767 | char *dynbuf = NULL; | 777 | char *dynbuf = NULL; |
diff --git a/src/lib/libcrypto/bio/bss_bio.c b/src/lib/libcrypto/bio/bss_bio.c index a5da473031..1c485a4479 100644 --- a/src/lib/libcrypto/bio/bss_bio.c +++ b/src/lib/libcrypto/bio/bss_bio.c | |||
| @@ -7,9 +7,18 @@ | |||
| 7 | * for which no specific BIO method is available. | 7 | * for which no specific BIO method is available. |
| 8 | * See ssl/ssltest.c for some hints on how this can be used. */ | 8 | * See ssl/ssltest.c for some hints on how this can be used. */ |
| 9 | 9 | ||
| 10 | /* BIO_DEBUG implies BIO_PAIR_DEBUG */ | ||
| 11 | #ifdef BIO_DEBUG | ||
| 12 | # ifndef BIO_PAIR_DEBUG | ||
| 13 | # define BIO_PAIR_DEBUG | ||
| 14 | # endif | ||
| 15 | #endif | ||
| 16 | |||
| 17 | /* disable assert() unless BIO_PAIR_DEBUG has been defined */ | ||
| 10 | #ifndef BIO_PAIR_DEBUG | 18 | #ifndef BIO_PAIR_DEBUG |
| 11 | # undef NDEBUG /* avoid conflicting definitions */ | 19 | # ifndef NDEBUG |
| 12 | # define NDEBUG | 20 | # define NDEBUG |
| 21 | # endif | ||
| 13 | #endif | 22 | #endif |
| 14 | 23 | ||
| 15 | #include <assert.h> | 24 | #include <assert.h> |
