diff options
author | Doug Hogan <doug@cvs.openbsd.org> | 2015-04-29 01:23:21 +0000 |
---|---|---|
committer | Doug Hogan <doug@cvs.openbsd.org> | 2015-04-29 01:23:21 +0000 |
commit | eb991b8896c3b3bbfbd50b6a3e77e6d6ae965fd3 (patch) | |
tree | cd87022ab496865487e99070479368df77f32c81 /lib/libssl/bs_cbs.c | |
parent | 089248566d3c557bd78b4d2a043bb90d16ef6e1d (diff) |
Added error checking for len argument in cbs_get_u().
tweak + ok jsing@
Diffstat (limited to 'lib/libssl/bs_cbs.c')
-rw-r--r-- | lib/libssl/bs_cbs.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libssl/bs_cbs.c b/lib/libssl/bs_cbs.c index 25305b9edd2..fc2eafff0eb 100644 --- a/lib/libssl/bs_cbs.c +++ b/lib/libssl/bs_cbs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bs_cbs.c,v 1.4 2015/04/29 01:16:06 doug Exp $ */ +/* $OpenBSD: bs_cbs.c,v 1.5 2015/04/29 01:23:20 doug Exp $ */ /* * Copyright (c) 2014, Google Inc. * @@ -110,6 +110,9 @@ cbs_get_u(CBS *cbs, uint32_t *out, size_t len) size_t i; const uint8_t *data; + if (len < 1 || len > 4) + return 0; + if (!cbs_get(cbs, &data, len)) return 0; |