Skip to content

Commit e0db992

Browse files
committed
wolfcrypt/src/asn.c: fix -Wstringop-truncation from gcc-16.0.0_p20260104 in KeyPemToDerPassCb().
1 parent 6f48e06 commit e0db992

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

wolfcrypt/src/asn.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27660,8 +27660,8 @@ static int KeyPemToDerPassCb(char* passwd, int sz, int rw, void* userdata)
2766027660
if (userdata == NULL)
2766127661
return 0;
2766227662

27663-
XSTRNCPY(passwd, (char*)userdata, (size_t)sz);
27664-
return (int)min((word32)sz, (word32)XSTRLEN((char*)userdata));
27663+
XSTRLCPY(passwd, (char*)userdata, (size_t)sz);
27664+
return (int)min((word32)(sz - 1), (word32)XSTRLEN((char*)userdata));
2766527665
}
2766627666
#endif
2766727667

0 commit comments

Comments
 (0)