Skip to content

Conversation

@mattcaswell
Copy link
Member

Some variables are uninitialised on use in the event of an error condition. This issue doesn't seem to be present in the master/1.1.0 versions, so I'm not sure how that happened.

Also a misplaced -1 means the buffer size used for the SSL_read() call is the size of a char * not the size of the array.

Fixes #4865

Checklist
  • documentation is added or updated
  • tests are added or updated

@mattcaswell mattcaswell added the branch: 1.0.2 Applies to OpenSSL_1_0_2-stable branch (EOL) label Dec 7, 2017
@Sp1l
Copy link
Contributor

Sp1l commented Dec 7, 2017

Confirmed that fatalerrtest.c builds OK with clang 4 with these 2 patches.


/* SSL_read()/SSL_write should fail because of a previous fatal error */
if ((len = SSL_read(sssl, buf, sizeof(buf - 1))) > 0) {
if ((len = SSL_read(sssl, buf, sizeof(buf) - 1)) > 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That one was particularly painful...

levitte pushed a commit that referenced this pull request Dec 7, 2017
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from #4866)
levitte pushed a commit that referenced this pull request Dec 7, 2017
Fixes #4865

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from #4866)
@richsalz
Copy link
Contributor

richsalz commented Dec 7, 2017

I merged this.

@richsalz richsalz closed this Dec 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

branch: 1.0.2 Applies to OpenSSL_1_0_2-stable branch (EOL)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants