Skip to content

Commit f713cdb

Browse files
committed
Fix evp const warning and pk buffer warning
1 parent aa56c40 commit f713cdb

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/pk.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,10 @@ static int wolfssl_print_indent(WOLFSSL_BIO* bio, char* line, int lineLen,
737737
int ret = 1;
738738

739739
if (indent > 0) {
740+
/* Cap indent to buffer size to avoid format truncation warning */
741+
if (indent >= lineLen) {
742+
indent = lineLen - 1;
743+
}
740744
/* Print indent spaces. */
741745
int len_wanted = XSNPRINTF(line, (size_t)lineLen, "%*s", indent, " ");
742746
if ((len_wanted < 0) || (len_wanted >= lineLen)) {

wolfcrypt/src/evp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6820,7 +6820,7 @@ void wolfSSL_EVP_init(void)
68206820
}
68216821

68226822
static int EvpCipherAesGCM(WOLFSSL_EVP_CIPHER_CTX* ctx, byte* dst,
6823-
byte* src, word32 len)
6823+
const byte* src, word32 len)
68246824
{
68256825
int ret = WC_NO_ERR_TRACE(WOLFSSL_FAILURE);
68266826

0 commit comments

Comments
 (0)