bio_socket_wait
API Overview
BIO_socket_wait is an API in openssl. This rule belongs to the return value check type. This rule is generated using AURC.
Rule Description
tip
BIO_socket_wait(), BIO_wait(), and BIO_do_connect_retry() return -1 on error, 0 on timeout, and 1 on success.
info
- Tags: return value check
- Parameter Index: N/A
- CWE Type: CWE-253
Rule Code
import cpp
class OpenSSLFunctionCall extends FunctionCall {
OpenSSLFunctionCall() {
this.getTarget().hasName("BIO_socket_wait")
}
}
from OpenSSLFunctionCall call, UnaryOperation uop
where
uop.getOperator() = "!" and
uop.getOperand() = call.getAnAccess()
select uop, "This negation checks the return value of BIO_socket_wait."