summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2014-10-12 20:47:13 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2014-10-12 20:47:13 +0000
commit2cd5db3c658c54ee7d220794a4598e8f5a5b0f56 (patch)
treedba9d323d1bbfb8e356526f1c0f6531c4ae15bc6 /lib
parentba0bc1af20241a5775ad9db2ca9cdfd08ab06d6f (diff)
Paranoia: in ASN1_mbstring_ncopy(), check for len < 0 instead of len == -1,
in order to catch all negative sizes.
Diffstat (limited to 'lib')
-rw-r--r--lib/libcrypto/asn1/a_mbstr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libcrypto/asn1/a_mbstr.c b/lib/libcrypto/asn1/a_mbstr.c
index 985d29824da..9ce0a000feb 100644
--- a/lib/libcrypto/asn1/a_mbstr.c
+++ b/lib/libcrypto/asn1/a_mbstr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: a_mbstr.c,v 1.20 2014/09/21 12:14:34 miod Exp $ */
+/* $OpenBSD: a_mbstr.c,v 1.21 2014/10/12 20:47:12 miod Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999.
*/
@@ -104,7 +104,7 @@ ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
int nchar;
int (*cpyfunc)(unsigned long, void *) = NULL;
- if (len == -1)
+ if (len < 0)
len = strlen((const char *)in);
if (!mask)
mask = DIRSTRING_TYPE;