Fix off by one issue in buf2hexstr_sep()
authorshridhar kalavagunta <coolshrid@hotmail.com>
Sat, 27 Jan 2024 03:10:32 +0000 (21:10 -0600)
committerTomas Mraz <tomas@openssl.org>
Fri, 1 Mar 2024 09:51:04 +0000 (10:51 +0100)
Fixes #23363

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23404)

(cherry picked from commit c5cc9c419a0a8d97a44f01f95f0e213f56da4574)

crypto/o_str.c

index 3354ce0927d01b93898fd97744813cc047a9f384..f9e04f22ed8f283c9df340c3d53a5f22fc9c41ca 100644 (file)
@@ -251,7 +251,7 @@ static int buf2hexstr_sep(char *str, size_t str_n, size_t *strlength,
     *q = CH_ZERO;
 
 #ifdef CHARSET_EBCDIC
-    ebcdic2ascii(str, str, q - str - 1);
+    ebcdic2ascii(str, str, q - str);
 #endif
     return 1;
 }