Fixes from overnight build failures

ssl.c: Certificate store fields freed without being NULLed and then
freed again.
integer.c: Compiler complained that a->dp may be NULL in mp_set_bit when
setting bit.
pkcs12.c: ret is zero after GetLength and this is an error but data is
freed only when ret != 0.
pkcs7.c: derArr was not zeroized for full allocated size.
This commit is contained in:
Sean Parkinson
2019-09-16 10:21:08 +10:00
parent 9d69f17f17
commit 000fc64f27
4 changed files with 16 additions and 23 deletions

View File

@@ -2831,7 +2831,7 @@ int mp_set_bit (mp_int * a, int b)
{
int i = b / DIGIT_BIT, res;
if (a->used < (int)(i + 1)) {
if (a->dp == NULL || a->used < (int)(i + 1)) {
/* grow a to accommodate the single bit */
if ((res = mp_grow (a, i + 1)) != MP_OKAY) {
return res;