提交 460e920d 编写于 作者: R Richard Godbee 提交者: Richard Levitte

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: NRichard Levitte <levitte@openssl.org>
Reviewed-by: NMatt Caswell <matt@openssl.org>
上级 e1b568dd
...@@ -70,14 +70,17 @@ long BIO_debug_callback(BIO *bio, int cmd, const char *argp, ...@@ -70,14 +70,17 @@ long BIO_debug_callback(BIO *bio, int cmd, const char *argp,
char buf[256]; char buf[256];
char *p; char *p;
long r = 1; long r = 1;
int len;
size_t p_maxlen; size_t p_maxlen;
if (BIO_CB_RETURN & cmd) if (BIO_CB_RETURN & cmd)
r = ret; r = ret;
BIO_snprintf(buf, sizeof buf, "BIO[%08lX]:", (unsigned long)bio); len = BIO_snprintf(buf,sizeof buf,"BIO[%p]: ",(void *)bio);
p = &(buf[14]);
p_maxlen = sizeof buf - 14; p = buf + len;
p_maxlen = sizeof(buf) - len;
switch (cmd) { switch (cmd) {
case BIO_CB_FREE: case BIO_CB_FREE:
BIO_snprintf(p, p_maxlen, "Free - %s\n", bio->method->name); BIO_snprintf(p, p_maxlen, "Free - %s\n", bio->method->name);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册