diff options
author | Dmitry-Me <wipedout@yandex.ru> | 2014-06-01 21:30:52 +0400 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2015-03-09 21:05:39 +0100 |
commit | b65b4c3481d9fc88056cd8373fd693d888ca064f (patch) | |
tree | b4a344b8debfe4faed7fea656f85ac4dc5c0bef5 /crypto | |
parent | ef116b000314848b6aa11a2d9f5205b82c8b59b4 (diff) |
Fix wrong numbers being passed as string lengths
Signed-off-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit 0b142f022e2c5072295e00ebc11c5b707a726d74)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/asn1/asn1_gen.c | 2 | ||||
-rw-r--r-- | crypto/asn1/asn1_par.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/crypto/asn1/asn1_gen.c b/crypto/asn1/asn1_gen.c index aaec009f22..b71ae4841b 100644 --- a/crypto/asn1/asn1_gen.c +++ b/crypto/asn1/asn1_gen.c @@ -359,7 +359,7 @@ static int asn1_cb(const char *elem, int len, void *bitstr) arg->format = ASN1_GEN_FORMAT_UTF8; else if (!strncmp(vstart, "HEX", 3)) arg->format = ASN1_GEN_FORMAT_HEX; - else if (!strncmp(vstart, "BITLIST", 3)) + else if (!strncmp(vstart, "BITLIST", 7)) arg->format = ASN1_GEN_FORMAT_BITLIST; else { ASN1err(ASN1_F_ASN1_CB, ASN1_R_UNKOWN_FORMAT); diff --git a/crypto/asn1/asn1_par.c b/crypto/asn1/asn1_par.c index f6cd4b2b8c..a5d2da10bb 100644 --- a/crypto/asn1/asn1_par.c +++ b/crypto/asn1/asn1_par.c @@ -337,7 +337,7 @@ static int asn1_parse2(BIO *bp, const unsigned char **pp, long length, goto end; } } else { - if (BIO_write(bp, "BAD ENUMERATED", 11) <= 0) + if (BIO_write(bp, "BAD ENUMERATED", 14) <= 0) goto end; } M_ASN1_ENUMERATED_free(bs); |