Merge pull request #910 from hardening/hardening9

Fixed padding management when reading certificate
This commit is contained in:
Marc-André Moreau 2013-01-18 11:29:41 -08:00
commit af5ea0e7fc

View File

@ -197,15 +197,14 @@ BOOL certificate_read_x509_certificate(rdpCertBlob* cert, rdpCertInfo* info)
/* skip zero padding, if any */
do
{
if(stream_get_left(s) < padding)
if(stream_get_left(s) < 1)
goto error1;
stream_peek_BYTE(s, padding);
if (padding == 0)
{
if(stream_get_left(s) < 1)
if(!stream_skip(s, 1))
goto error1;
stream_seek(s, 1);
modulus_length--;
}
}