Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=
1643042
Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=
1643047
Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=
1643089
Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=
1643091
Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=
1643095
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26845)
BUF_MEM *buf_mem = BUF_MEM_new();
if (buffer == NULL || buf_mem == NULL
- || (token->is_retry != 0 && token->is_retry != 1))
+ || (token->is_retry != 0 && token->is_retry != 1)) {
+ BUF_MEM_free(buf_mem);
return 0;
+ }
if (!WPACKET_init(&wpkt, buf_mem)
|| !WPACKET_memset(&wpkt, token->is_retry, 1)
if (fd2 == fd1) {
fd2 = -1;
- fd1_w = fd1_w || fd2_w;
+ fd1_w = fd2_w;
}
- if (fd1 != -1 && (fd1_r || fd1_w))
+ if (fd1 != -1)
if (!ossl_rio_poll_builder_add_fd(rpb, fd1, fd1_r, fd1_w))
return 0;
* If the two arguments are equal then one fewer reference is granted by the
* caller than we want to take
*/
- if (rbio != NULL && rbio == wbio)
- BIO_up_ref(rbio);
+ if (rbio != NULL && rbio == wbio) {
+ if (!BIO_up_ref(rbio))
+ return;
+ }
/*
* If only the wbio is changed only adopt one reference.
ktls_enable(fd);
#endif /* OPENSSL_NO_KTLS */
} else {
- BIO_up_ref(rbio);
+ if (!BIO_up_ref(rbio))
+ return 0;
SSL_set0_wbio(s, rbio);
}
return 1;
BIO_set_fd(bio, fd, BIO_NOCLOSE);
SSL_set0_rbio(s, bio);
} else {
- BIO_up_ref(wbio);
+ if (!BIO_up_ref(wbio))
+ return 0;
SSL_set0_rbio(s, wbio);
}