rtadvd(8): Fix use-after-close in cm_handler_client
cm_send() closes 'fd' on error. In that case, bail out early without trying to recv from or close 'fd' again. Reported by: Coverity CID: 1006078 Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
parent
5f28b4bf85
commit
3571021d22
@ -92,9 +92,11 @@ cm_handler_client(int fd, int state, char *buf_orig)
|
||||
case CM_STATE_MSG_DISPATCH:
|
||||
cm->cm_version = CM_VERSION;
|
||||
error = cm_send(fd, buf);
|
||||
if (error)
|
||||
if (error) {
|
||||
syslog(LOG_WARNING,
|
||||
"<%s> cm_send()", __func__);
|
||||
return (-1);
|
||||
}
|
||||
state = CM_STATE_ACK_WAIT;
|
||||
break;
|
||||
case CM_STATE_ACK_WAIT:
|
||||
|
Loading…
x
Reference in New Issue
Block a user