aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2015-05-04 16:16:27 +0200
committerAndreas Schneider <asn@cryptomilk.org>2015-05-04 17:54:01 +0200
commit05498e0e33f575948026316b560666213535d5ed (patch)
tree9d9bf44432d87a0f4aa32699a6897fbce948c519
parent4948fe21cdf3de23554271e66d4c1db4a6a8a24d (diff)
downloadlibssh-05498e0e33f575948026316b560666213535d5ed.tar.gz
libssh-05498e0e33f575948026316b560666213535d5ed.tar.xz
libssh-05498e0e33f575948026316b560666213535d5ed.zip
pki_container: Add check for return value
CID: #1267982 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r--src/pki_container_openssh.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pki_container_openssh.c b/src/pki_container_openssh.c
index c2aface2..c276f486 100644
--- a/src/pki_container_openssh.c
+++ b/src/pki_container_openssh.c
@@ -484,7 +484,10 @@ static int pki_private_key_encrypt(ssh_buffer privkey_buffer,
return SSH_ERROR;
}
while (ssh_buffer_get_len(privkey_buffer) % cipher.blocksize != 0) {
- buffer_add_u8(privkey_buffer, padding);
+ rc = buffer_add_u8(privkey_buffer, padding);
+ if (rc < 0) {
+ return SSH_ERROR;
+ }
padding++;
}