aboutsummaryrefslogtreecommitdiff
path: root/src/buffer.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2015-02-02 17:06:23 +0100
committerAndreas Schneider <asn@cryptomilk.org>2015-02-02 17:32:34 +0100
commitad8fa427dda9a0e722935141d3b84a620e13dcd4 (patch)
tree99357b4bdef2e0f5a54c5aa4f9fe5a6c10716e57 /src/buffer.c
parentde10a7754b7cfe4f5956ff575113211f222f960b (diff)
downloadlibssh-ad8fa427dda9a0e722935141d3b84a620e13dcd4.tar.gz
libssh-ad8fa427dda9a0e722935141d3b84a620e13dcd4.tar.xz
libssh-ad8fa427dda9a0e722935141d3b84a620e13dcd4.zip
buffer: Abort if the canary is not intact in ssh_buffer_unpack()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be>
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c4
1 files 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();
}
}