diff options
author | jkim <jkim@FreeBSD.org> | 2015-06-11 19:00:55 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2015-06-11 19:00:55 +0000 |
commit | d675e841ef78a78bab5972d63fa3d8d15ecdbb19 (patch) | |
tree | af421c8f5f156e1b4b26149d5c4964d037dd0454 /crypto/openssl/crypto/des/enc_writ.c | |
parent | aec7d82113b7de83f7ac3f9470fde49813358dec (diff) | |
download | FreeBSD-src-d675e841ef78a78bab5972d63fa3d8d15ecdbb19.zip FreeBSD-src-d675e841ef78a78bab5972d63fa3d8d15ecdbb19.tar.gz |
Merge OpenSSL 1.0.1n.
Diffstat (limited to 'crypto/openssl/crypto/des/enc_writ.c')
-rw-r--r-- | crypto/openssl/crypto/des/enc_writ.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/crypto/openssl/crypto/des/enc_writ.c b/crypto/openssl/crypto/des/enc_writ.c index b4eecc3..bfaabde 100644 --- a/crypto/openssl/crypto/des/enc_writ.c +++ b/crypto/openssl/crypto/des/enc_writ.c @@ -96,6 +96,9 @@ int DES_enc_write(int fd, const void *_buf, int len, const unsigned char *cp; static int start = 1; + if (len < 0) + return -1; + if (outbuf == NULL) { outbuf = OPENSSL_malloc(BSIZE + HDRSIZE); if (outbuf == NULL) @@ -132,7 +135,9 @@ int DES_enc_write(int fd, const void *_buf, int len, if (len < 8) { cp = shortbuf; memcpy(shortbuf, buf, len); - RAND_pseudo_bytes(shortbuf + len, 8 - len); + if (RAND_pseudo_bytes(shortbuf + len, 8 - len) < 0) { + return -1; + } rnum = 8; } else { cp = buf; |