From b5f40eb279e37c86d0634db5ffcc37517ea97694 Mon Sep 17 00:00:00 2001 From: Viktor Dukhovni Date: Wed, 16 Mar 2016 23:58:58 -0400 Subject: [PATCH] Bugfix: Encode the requested length in s_cb.c:hexencode() Reviewed-by: Rich Salz --- apps/s_cb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/s_cb.c b/apps/s_cb.c index 047f2cec8b..66b2a50dde 100644 --- a/apps/s_cb.c +++ b/apps/s_cb.c @@ -1106,7 +1106,7 @@ static char *hexencode(const unsigned char *data, size_t len) } cp = out = app_malloc(ilen, "TLSA hex data buffer"); - while (ilen-- > 0) { + while (len-- > 0) { *cp++ = hex[(*data >> 4) & 0x0f]; *cp++ = hex[*data++ & 0x0f]; } -- 2.40.0