summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/f_enum.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/asn1/f_enum.c')
-rw-r--r--src/lib/libcrypto/asn1/f_enum.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/libcrypto/asn1/f_enum.c b/src/lib/libcrypto/asn1/f_enum.c
index 952b908985..7cf0abb428 100644
--- a/src/lib/libcrypto/asn1/f_enum.c
+++ b/src/lib/libcrypto/asn1/f_enum.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: f_enum.c,v 1.12 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: f_enum.c,v 1.13 2014/07/10 21:58:08 miod Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -104,7 +104,8 @@ a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size)
104 int i, j,k, m,n, again, bufsize; 104 int i, j,k, m,n, again, bufsize;
105 unsigned char *s = NULL, *sp; 105 unsigned char *s = NULL, *sp;
106 unsigned char *bufp; 106 unsigned char *bufp;
107 int num = 0, slen = 0, first = 1; 107 int first = 1;
108 size_t num = 0, slen = 0;
108 109
109 bs->type = V_ASN1_ENUMERATED; 110 bs->type = V_ASN1_ENUMERATED;
110 111
@@ -154,7 +155,7 @@ a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size)
154 } 155 }
155 i /= 2; 156 i /= 2;
156 if (num + i > slen) { 157 if (num + i > slen) {
157 sp = realloc(s, (unsigned int)num + i); 158 sp = realloc(s, num + i);
158 if (sp == NULL) { 159 if (sp == NULL) {
159 ASN1err(ASN1_F_A2I_ASN1_ENUMERATED, 160 ASN1err(ASN1_F_A2I_ASN1_ENUMERATED,
160 ERR_R_MALLOC_FAILURE); 161 ERR_R_MALLOC_FAILURE);