1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-29 01:03:57 +03:00

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>
This commit is contained in:
Andreas Schneider
2015-02-02 16:54:22 +01:00
parent afc9988c93
commit 6789170799

View File

@@ -787,10 +787,10 @@ int ssh_buffer_pack_va(struct ssh_buffer_struct *buffer,
}
if (rc != SSH_ERROR){
/* verify that the last hidden argument is correct */
o.dword = va_arg(ap, uint32_t);
if (o.dword != SSH_BUFFER_PACK_END){
rc = SSH_ERROR;
/* 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) {
abort();
}
}
return rc;