Skip to content

server read check relies on boolean short circuiting #1

Description

@CardboardBread

in chopserver.c:98:
if (client != NULL && FD_ISSET(client->socket_fd, &listen_fds)) {
conventionally, the statement could segfault if the right side is evaluated before the left, but since the left side is (assumedly) evaluated first the program can immediately return the conditional when it's false.

A suggested change is:
if (client != NULL) {
if (FD_ISSET(client->socket_fd, &listen_fds)) {

Metadata

Metadata

Labels

invalidThis doesn't seem right

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions