summaryrefslogtreecommitdiff
path: root/usr.sbin/relayd
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2014-07-11 22:57:26 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2014-07-11 22:57:26 +0000
commit95e961976a467f2d2e570f8ad265579204d61f61 (patch)
treed90e249fb176cfa71f840dd4ba8f712925f57a54 /usr.sbin/relayd
parentb0c253ff72a0e8913218a63ea7af6e28248a3e1d (diff)
As reported by David Ramos, most consumer of ssl_get_message() perform late
bounds check, after reading the 2-, 3- or 4-byte size of the next chunk to process. But the size fields themselves are not checked for being entirely contained in the buffer. Since reading past your bounds is bad practice, and may not possible if you are using a secure memory allocator, we need to add the necessary bounds check, at the expense of some readability. As a bonus, a wrong size GOST session key will now trigger an error instead of a printf to stderr and it being handled as if it had the correct size. Creating this diff made my eyes bleed (in the real sense); reviewing it made guenther@'s and beck@'s eyes bleed too (in the literal sense). ok guenther@ beck@
Diffstat (limited to 'usr.sbin/relayd')
0 files changed, 0 insertions, 0 deletions