Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clarify the peer pointer's validity using an assertion (CWE-476)
The prior switch statement dereferences the peer pointer in each valid case, so if peer really was NULL then the program will have crashed due to derefercing a null pointer. Thus, this peer != NULL statement is misleading: it implies that peer might legitimately be NULL, when infact, we expect peer to be valid at this point. So instead, we replace this checking with our expectation (using an assertion). Flagged by Coverity: In enet_protocol_handle_incoming_commands(_ENetHost *, _ENetEvent *): All paths that lead to this null pointer comparison already dereference the pointer earlier (CWE-476)
- Loading branch information