fix possible out of bounds read in PemToDer, CU #1

This commit is contained in:
Chris Conlon
2016-06-24 13:57:09 -06:00
parent 19da114c0c
commit 8fac3fffea

View File

@@ -3534,7 +3534,7 @@ int PemToDer(const unsigned char* buff, long longSz, int type,
/* eat end of line */
if (consumedEnd[0] == '\n')
consumedEnd++;
else if (consumedEnd[1] == '\n')
else if ((consumedEnd + 1 < bufferEnd) && consumedEnd[1] == '\n')
consumedEnd += 2;
else {
if (info)