summaryrefslogtreecommitdiffstats
path: root/lib/libssl/s3_lib.c
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2014-08-07 19:46:31 +0000
committermiod <miod@openbsd.org>2014-08-07 19:46:31 +0000
commitffb772b401a7e4d8ff166372a160eb0da562824c (patch)
tree4204be25125390a03429c66abc90c5b245fee015 /lib/libssl/s3_lib.c
parentBump example pubkey filenames to /etc/signify/openbsd-56-base.pub for (diff)
downloadwireguard-openbsd-ffb772b401a7e4d8ff166372a160eb0da562824c.tar.xz
wireguard-openbsd-ffb772b401a7e4d8ff166372a160eb0da562824c.zip
When you expect a function to return a particular value, don't put a comment
saying that you expect it to return that value and compare it against zero because it is supposedly faster, for this leads to bugs (especially given the high rate of sloppy cut'n'paste within ssl3 and dtls1 routines in this library). Instead, compare for the exact value it ought to return upon success. ok deraadt@
Diffstat (limited to 'lib/libssl/s3_lib.c')
-rw-r--r--lib/libssl/s3_lib.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/libssl/s3_lib.c b/lib/libssl/s3_lib.c
index 8a40b758a92..aa091f51c7c 100644
--- a/lib/libssl/s3_lib.c
+++ b/lib/libssl/s3_lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: s3_lib.c,v 1.71 2014/07/13 16:03:10 beck Exp $ */
+/* $OpenBSD: s3_lib.c,v 1.72 2014/08/07 19:46:31 miod Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -2333,7 +2333,7 @@ ssl3_new(SSL *s)
SSL3_STATE *s3;
if ((s3 = calloc(1, sizeof *s3)) == NULL)
- goto err;
+ return 0;
memset(s3->rrec.seq_num, 0, sizeof(s3->rrec.seq_num));
memset(s3->wrec.seq_num, 0, sizeof(s3->wrec.seq_num));
@@ -2341,8 +2341,6 @@ ssl3_new(SSL *s)
s->method->ssl_clear(s);
return (1);
-err:
- return (0);
}
void