From c908a161bf88d8b8b94b0e664013a31bb71ebe9c Mon Sep 17 00:00:00 2001 From: Doug Hogan Date: Wed, 29 Apr 2015 01:23:21 +0000 Subject: Added error checking for len argument in cbs_get_u(). tweak + ok jsing@ --- lib/libssl/src/ssl/bs_cbs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/libssl/src/ssl/bs_cbs.c b/lib/libssl/src/ssl/bs_cbs.c index 25305b9edd2..fc2eafff0eb 100644 --- a/lib/libssl/src/ssl/bs_cbs.c +++ b/lib/libssl/src/ssl/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; -- cgit v1.2.3