mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-29 18:27:29 +02:00
Fixed possible buffer overflow in wc_DerToPemEx.
This commit is contained in:
@ -8909,9 +8909,9 @@ int wc_DerToPemEx(const byte* der, word32 derSz, byte* output, word32 outSz,
|
||||
|
||||
/* build header and footer based on type */
|
||||
XSTRNCPY(header, headerStr, headerLen - 1);
|
||||
header[headerLen - 1] = 0;
|
||||
header[headerLen - 2] = 0;
|
||||
XSTRNCPY(footer, footerStr, footerLen - 1);
|
||||
footer[footerLen - 1] = 0;
|
||||
footer[footerLen - 2] = 0;
|
||||
|
||||
/* add new line to end */
|
||||
XSTRNCAT(header, "\n", 2);
|
||||
|
Reference in New Issue
Block a user