From ad8fa427dda9a0e722935141d3b84a620e13dcd4 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 2 Feb 2015 17:06:23 +0100 Subject: [PATCH] buffer: Abort if the canary is not intact in ssh_buffer_unpack() Signed-off-by: Andreas Schneider Reviewed-by: Aris Adamantiadis --- src/buffer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/buffer.c b/src/buffer.c index 983bc789..d5ef6778 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -961,10 +961,10 @@ int ssh_buffer_unpack_va(struct ssh_buffer_struct *buffer, } if (rc != SSH_ERROR){ - /* verify that the last hidden argument is correct */ + /* Check if our canary is intact, if not somthing really bad happened */ uint32_t canary = va_arg(ap, uint32_t); if (canary != SSH_BUFFER_PACK_END){ - rc = SSH_ERROR; + abort(); } }