Fix from testing

This commit is contained in:
Eric Blankenhorn
2025-10-13 12:15:39 -05:00
parent e47be2163a
commit 83336e3436

View File

@@ -737,12 +737,13 @@ static int wolfssl_print_indent(WOLFSSL_BIO* bio, char* line, int lineLen,
int ret = 1;
if (indent > 0) {
int len_wanted;
/* Cap indent to buffer size to avoid format truncation warning */
if (indent >= lineLen) {
indent = lineLen - 1;
}
/* Print indent spaces. */
int len_wanted = XSNPRINTF(line, (size_t)lineLen, "%*s", indent, " ");
len_wanted = XSNPRINTF(line, (size_t)lineLen, "%*s", indent, " ");
if ((len_wanted < 0) || (len_wanted >= lineLen)) {
WOLFSSL_ERROR_MSG("Buffer overflow formatting indentation");
ret = 0;