Commit 460e920d authored by Richard Godbee's avatar Richard Godbee Committed by Richard Levitte
Browse files

BIO_debug_callback: Fix output on 64-bit machines



BIO_debug_callback() no longer assumes the hexadecimal representation of
a pointer fits in 8 characters.

Signed-off-by: default avatarRichard Levitte <levitte@openssl.org>
Reviewed-by: default avatarMatt Caswell <matt@openssl.org>
parent e1b568dd
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -70,14 +70,17 @@ long BIO_debug_callback(BIO *bio, int cmd, const char *argp,
    char buf[256];
    char *p;
    long r = 1;
    int len;
    size_t p_maxlen;

    if (BIO_CB_RETURN & cmd)
        r = ret;

    BIO_snprintf(buf, sizeof buf, "BIO[%08lX]:", (unsigned long)bio);
    p = &(buf[14]);
    p_maxlen = sizeof buf - 14;
    len = BIO_snprintf(buf,sizeof buf,"BIO[%p]: ",(void *)bio);

    p = buf + len;
    p_maxlen = sizeof(buf) - len;

    switch (cmd) {
    case BIO_CB_FREE:
        BIO_snprintf(p, p_maxlen, "Free - %s\n", bio->method->name);