diff options
| author | Gary Lin <glin@suse.com> | 2016-10-13 15:57:25 +0800 |
|---|---|---|
| committer | Peter Jones <pjones@redhat.com> | 2016-11-30 12:57:34 -0500 |
| commit | b371a682fb67ff945a8095437b9b33cab549bb49 (patch) | |
| tree | 55aa1f4552b1c96dbfd1b110e210cb7471ee06e4 /Cryptlib/OpenSSL/crypto/asn1/a_set.c | |
| parent | 43ad947f6e7d1e899d86fd8ca66a55ffbc3ed2b2 (diff) | |
| download | efi-boot-shim-b371a682fb67ff945a8095437b9b33cab549bb49.tar.gz efi-boot-shim-b371a682fb67ff945a8095437b9b33cab549bb49.zip | |
Update to openssl 1.0.2j
Signed-off-by: Gary Lin <glin@suse.com>
Diffstat (limited to 'Cryptlib/OpenSSL/crypto/asn1/a_set.c')
| -rw-r--r-- | Cryptlib/OpenSSL/crypto/asn1/a_set.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Cryptlib/OpenSSL/crypto/asn1/a_set.c b/Cryptlib/OpenSSL/crypto/asn1/a_set.c index bf3f9718..5fb58655 100644 --- a/Cryptlib/OpenSSL/crypto/asn1/a_set.c +++ b/Cryptlib/OpenSSL/crypto/asn1/a_set.c @@ -57,6 +57,7 @@ */ #include <stdio.h> +#include <limits.h> #include "cryptlib.h" #include <openssl/asn1_mac.h> @@ -98,10 +99,14 @@ int i2d_ASN1_SET(STACK_OF(OPENSSL_BLOCK) *a, unsigned char **pp, if (a == NULL) return (0); - for (i = sk_OPENSSL_BLOCK_num(a) - 1; i >= 0; i--) + for (i = sk_OPENSSL_BLOCK_num(a) - 1; i >= 0; i--) { + int tmplen = i2d(sk_OPENSSL_BLOCK_value(a, i), NULL); + if (tmplen > INT_MAX - ret) + return -1; ret += i2d(sk_OPENSSL_BLOCK_value(a, i), NULL); + } r = ASN1_object_size(1, ret, ex_tag); - if (pp == NULL) + if (pp == NULL || r == -1) return (r); p = *pp; |
