From 92e501c8e4d6138627be10b5d74bc7a41adc403d Mon Sep 17 00:00:00 2001 From: Chris Conlon Date: Fri, 24 Jun 2016 14:37:45 -0600 Subject: [PATCH] fix possible out of bound read in PemToDer header, CU #3 --- src/ssl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ssl.c b/src/ssl.c index 5999bb5fd..d4fcaa0ba 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -3456,6 +3456,9 @@ int PemToDer(const unsigned char* buff, long longSz, int type, headerEnd += XSTRLEN(header); + if ((headerEnd + 1) >= bufferEnd) + return SSL_BAD_FILE; + /* eat end of line */ if (headerEnd[0] == '\n') headerEnd++;