summaryrefslogtreecommitdiffstats
path: root/lib/libssl/src
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2014-05-18 19:30:36 +0000
committermiod <miod@openbsd.org>2014-05-18 19:30:36 +0000
commitf4feb42a2d400d74d2bb069505de172c22ccab1f (patch)
treef2428e438433b7248c7e00e9a2afd7292f349bd5 /lib/libssl/src
parentuse reallocarray (diff)
downloadwireguard-openbsd-f4feb42a2d400d74d2bb069505de172c22ccab1f.tar.xz
wireguard-openbsd-f4feb42a2d400d74d2bb069505de172c22ccab1f.zip
Make sure UTF8_getc() is invoked with the proper buffer size.
ok beck@ guenther@
Diffstat (limited to 'lib/libssl/src')
-rw-r--r--lib/libssl/src/crypto/asn1/a_strex.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libssl/src/crypto/asn1/a_strex.c b/lib/libssl/src/crypto/asn1/a_strex.c
index 248eac28f6a..462a4059bec 100644
--- a/lib/libssl/src/crypto/asn1/a_strex.c
+++ b/lib/libssl/src/crypto/asn1/a_strex.c
@@ -111,7 +111,7 @@ send_fp_chars(void *arg, const void *buf, int len)
{
if (!arg)
return 1;
- if (fwrite(buf, 1, len, arg) != (unsigned int)len)
+ if (fwrite(buf, 1, (size_t)len, arg) != (size_t)len)
return 0;
return 1;
}
@@ -227,7 +227,7 @@ do_buf(unsigned char *buf, int buflen, int type, unsigned char flags,
break;
case 0:
- i = UTF8_getc(p, buflen, &c);
+ i = UTF8_getc(p, q - p, &c);
if (i < 0)
return -1; /* Invalid UTF8String */
p += i;