Instead of:
+ if (wb->buf == NULL)
+ if (!ssl3_setup_write_buffer(s))
+ return -1;
Why not: + if (wb->buf == NULL) {
+ if (!ssl3_setup_write_buffer(s)) {
+ return -1;
+ }
+ }Disagree you may, but it's consistent with their self-imposed guidelines.
So technically, this is still OK, but they are allowed to use braces when there are multiple lines. (the if and the return) They have an example in that link that covers this as a permitted case, but as you say, it's OK and consistent, but that doesn't make it good :)
if ((wb->buf == NULL) && !ssl3_setup_write_buffer(s)) {
return -1;
}If writing defensively by always putting braces around if statements means we no longer have to consider the possibility of a fall through error, then that saves mental processing for you and more importantly for lesser programmers.
This only triggers a crash if you use RELEASE_BUFFERS (not the default) and a warning alert is written when the socket buffer is full. About the only case where a warning alert is generated is when a client attempts a renegotiation without the renegotiation extension (unless insecure renegotiation is allowed by the app). I've not been able to trigger the bug in a test because code generally stops reading once the socket buffer is full so you need the application to exactly fill the socket buffer (so that it doesn't get EAGAIN), then a warning alert can just exceed it.
[1] http://marc.info/?l=openssl-dev&m=139809493725682&w=2 [2] http://klee.github.io/klee/
Here is an example of its power and how to use it: http://feliam.wordpress.com/2010/10/07/the-symbolic-maze/
http://www.openbsdfoundation.org/donations.html
Apr 12, 2014
http://ftp.openbsd.org/pub/OpenBSD/patches/5.5/common/004_op...
-->>
2014-04-30
http://www.freebsd.org/security/advisories/FreeBSD-SA-14:09....
needed 18 days to reach other OSes, ex.: FreeBSD.. interesting lag..
Who knows for embedded devices.
This one is listed on that page (bottom 005: SECURITY FIX: May 1, 2014).