From 340396964513018694cc4c83317dc9b2997d641e Mon Sep 17 00:00:00 2001 From: Andrzej Kurek Date: Fri, 17 Jul 2020 05:49:47 -0400 Subject: [PATCH] Add a comment regarding remaining space check Signed-off-by: Andrzej Kurek --- library/pk.c | 1 + 1 file changed, 1 insertion(+) diff --git a/library/pk.c b/library/pk.c index 3bb91b284..fea75767b 100644 --- a/library/pk.c +++ b/library/pk.c @@ -659,6 +659,7 @@ static int asn1_write_mpibuf( unsigned char **p, unsigned char *start, len += 1; } + /* Ensure that there is still space for len and ASN1_INTEGER */ if( ( *p - start ) < 2 ) return( MBEDTLS_ERR_ASN1_BUF_TOO_SMALL );