mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-07 10:20:47 +02:00
Fix from testing
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user