sanity check on pointer

pull/1628/head
Jacob Barthelmeh 2018-06-20 09:37:36 -06:00
parent 61655ef56d
commit 777c89a257
1 changed files with 7 additions and 3 deletions

View File

@ -7508,13 +7508,17 @@ static int wc_EncryptedInfoParse(EncryptedInfo* info,
if (start == NULL)
return BUFFER_E;
if (start >= bufferEnd)
return BUFFER_E;
/* skip dec-info and ": " */
start += XSTRLEN(kDecInfoHeader);
if (start[0] == ':')
if (start >= bufferEnd)
return BUFFER_E;
if (start[0] == ':') {
start++;
if (start >= bufferEnd)
return BUFFER_E;
}
if (start[0] == ' ')
start++;