summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2005-11-05 16:04:36 +1100
committerDamien Miller <djm@mindrot.org>2005-11-05 16:04:36 +1100
commit5fd8b02b440fac52cbf70c203fbfc716a3620074 (patch)
treee2a16a0125695feb2d49a20d918aaaf8b0aaa6a0
parent19bb3a57f88adc789d61964fcb8f50165026b322 (diff)
- djm@cvs.openbsd.org 2005/11/05 05:01:15
[bufaux.c] Fix leaks in error paths, bz #1109 and #1110 reported by kremenek AT cs.stanford.edu; ok dtucker@
-rw-r--r--ChangeLog6
-rw-r--r--bufaux.c5
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 6fb0b7d35..46b40f197 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -98,6 +98,10 @@
98 remove hardcoded hash lengths in key exchange code, allowing 98 remove hardcoded hash lengths in key exchange code, allowing
99 implementation of KEX methods with different hashes (e.g. SHA-256); 99 implementation of KEX methods with different hashes (e.g. SHA-256);
100 ok markus@ dtucker@ stevesk@ 100 ok markus@ dtucker@ stevesk@
101 - djm@cvs.openbsd.org 2005/11/05 05:01:15
102 [bufaux.c]
103 Fix leaks in error paths, bz #1109 and #1110 reported by kremenek AT
104 cs.stanford.edu; ok dtucker@
101 105
10220051102 10620051102
103 - (dtucker) [openbsd-compat/bsd-misc.c] Bug #1108: fix broken strdup(). 107 - (dtucker) [openbsd-compat/bsd-misc.c] Bug #1108: fix broken strdup().
@@ -3231,4 +3235,4 @@
3231 - (djm) Trim deprecated options from INSTALL. Mention UsePAM 3235 - (djm) Trim deprecated options from INSTALL. Mention UsePAM
3232 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu 3236 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
3233 3237
3234$Id: ChangeLog,v 1.3951 2005/11/05 04:19:35 djm Exp $ 3238$Id: ChangeLog,v 1.3952 2005/11/05 05:04:36 djm Exp $
diff --git a/bufaux.c b/bufaux.c
index 8d096a056..106a3a0c7 100644
--- a/bufaux.c
+++ b/bufaux.c
@@ -37,7 +37,7 @@
37 */ 37 */
38 38
39#include "includes.h" 39#include "includes.h"
40RCSID("$OpenBSD: bufaux.c,v 1.36 2005/06/17 02:44:32 djm Exp $"); 40RCSID("$OpenBSD: bufaux.c,v 1.37 2005/11/05 05:01:15 djm Exp $");
41 41
42#include <openssl/bn.h> 42#include <openssl/bn.h>
43#include "bufaux.h" 43#include "bufaux.h"
@@ -63,6 +63,7 @@ buffer_put_bignum_ret(Buffer *buffer, const BIGNUM *value)
63 if (oi != bin_size) { 63 if (oi != bin_size) {
64 error("buffer_put_bignum_ret: BN_bn2bin() failed: oi %d != bin_size %d", 64 error("buffer_put_bignum_ret: BN_bn2bin() failed: oi %d != bin_size %d",
65 oi, bin_size); 65 oi, bin_size);
66 xfree(buf);
66 return (-1); 67 return (-1);
67 } 68 }
68 69
@@ -187,10 +188,12 @@ buffer_get_bignum2_ret(Buffer *buffer, BIGNUM *value)
187 188
188 if (len > 0 && (bin[0] & 0x80)) { 189 if (len > 0 && (bin[0] & 0x80)) {
189 error("buffer_get_bignum2_ret: negative numbers not supported"); 190 error("buffer_get_bignum2_ret: negative numbers not supported");
191 xfree(bin);
190 return (-1); 192 return (-1);
191 } 193 }
192 if (len > 8 * 1024) { 194 if (len > 8 * 1024) {
193 error("buffer_get_bignum2_ret: cannot handle BN of size %d", len); 195 error("buffer_get_bignum2_ret: cannot handle BN of size %d", len);
196 xfree(bin);
194 return (-1); 197 return (-1);
195 } 198 }
196 BN_bin2bn(bin, len, value); 199 BN_bin2bn(bin, len, value);