Actions
Bug #1219
closedMissing "return 0" after call to close(client) in unix-manager.c, line 299 (UnixCommandAccept(), Suricata 2.0.1)?
Affected Versions:
Effort:
Difficulty:
Label:
Description
In this code, after the error condition is checked, client is closed and the function returns with error code (as in many other similar checks).
if (ret < 0) { SCLogInfo("Command server: client doesn't send version"); close(client); return 0; }
But in the following code after client is closed, the function doesn't return:
if (ret >= (int)(sizeof(buffer)-1)) { SCLogInfo("Command server: client message is too long, " "disconnect him."); close(client); // MISSING return 0 here??? }
Then there could be attempts to close client again (and even use it at line 339), otherwise the line
uclient->fd = client;
is reached, but client could be closed. Previous versions (i.e 1.4.7) may also be affected.
Actions