summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjason <>2002-08-05 19:23:24 +0000
committerjason <>2002-08-05 19:23:24 +0000
commit5383fa10b90fae75038aefab3a0ef8f9dc3fd835 (patch)
tree9287f7d5e39955f454b99f37105daf5157cda2b7
parentc5c95eefd6134614711edfa693bb4aa5b5ee2a47 (diff)
downloadopenbsd-5383fa10b90fae75038aefab3a0ef8f9dc3fd835.tar.gz
openbsd-5383fa10b90fae75038aefab3a0ef8f9dc3fd835.tar.bz2
openbsd-5383fa10b90fae75038aefab3a0ef8f9dc3fd835.zip
Pull in patch from current:
Better fixes from openssl cvs; from markus@
-rw-r--r--src/lib/libssl/src/crypto/asn1/asn1_lib.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/libssl/src/crypto/asn1/asn1_lib.c b/src/lib/libssl/src/crypto/asn1/asn1_lib.c
index 1fe3fbc1fa..e4a56a926a 100644
--- a/src/lib/libssl/src/crypto/asn1/asn1_lib.c
+++ b/src/lib/libssl/src/crypto/asn1/asn1_lib.c
@@ -57,6 +57,7 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include <limits.h>
60#include "cryptlib.h" 61#include "cryptlib.h"
61#include <openssl/asn1.h> 62#include <openssl/asn1.h>
62#include <openssl/asn1_mac.h> 63#include <openssl/asn1_mac.h>
@@ -124,7 +125,7 @@ int ASN1_get_object(unsigned char **pp, long *plength, int *ptag, int *pclass,
124 (int)(omax+ *pp)); 125 (int)(omax+ *pp));
125 126
126#endif 127#endif
127 if (*plength > (omax - (*pp - p))) 128 if (*plength > (omax - (p - *pp)))
128 { 129 {
129 ASN1err(ASN1_F_ASN1_GET_OBJECT,ASN1_R_TOO_LONG); 130 ASN1err(ASN1_F_ASN1_GET_OBJECT,ASN1_R_TOO_LONG);
130 /* Set this so that even if things are not long enough 131 /* Set this so that even if things are not long enough
@@ -141,7 +142,7 @@ err:
141static int asn1_get_length(unsigned char **pp, int *inf, long *rl, int max) 142static int asn1_get_length(unsigned char **pp, int *inf, long *rl, int max)
142 { 143 {
143 unsigned char *p= *pp; 144 unsigned char *p= *pp;
144 long ret=0; 145 unsigned long ret=0;
145 int i; 146 int i;
146 147
147 if (max-- < 1) return(0); 148 if (max-- < 1) return(0);
@@ -170,10 +171,10 @@ static int asn1_get_length(unsigned char **pp, int *inf, long *rl, int max)
170 else 171 else
171 ret=i; 172 ret=i;
172 } 173 }
173 if (ret < 0) 174 if (ret > LONG_MAX)
174 return 0; 175 return 0;
175 *pp=p; 176 *pp=p;
176 *rl=ret; 177 *rl=(long)ret;
177 return(1); 178 return(1);
178 } 179 }
179 180