The following application code snippet crashes on NT server SP3 with an
access violation in the
fwrite() function of the C runtime library (Visual C++ 5.0);

#include <stdio.h>
#include <openssl/bio.h>

int main (int argc, char *argv[])
{
        BIO *bio_err=NULL;

    if (bio_err == NULL)
                if ((bio_err=BIO_new(BIO_s_file())) != NULL)
                        BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);

        BIO_printf(bio_err, "Test\n");
    return 1;
}

The OpenSSL library is built as a DLL and linked by the app. Threading
models etc of
the app and DLL are identical.

Interestingly, if I add bss_file.c to the app build, it works fine. I got
this hint from
apps.c which #include's bss_file.c under an #ifdef WINDOWS. Why exactly, is
this done ?
I'd like some more information on this if anyone has it, to fully understand
what's going on.

Thanx,

-----------------
Paul Keogh
SSE


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to