Skip to content

Commit 750a00a

Browse files
committed
Tear down on invalid recv
1 parent 3f9bc6b commit 750a00a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎src/privsep.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,7 +1094,7 @@ ps_recvpsmsg(struct dhcpcd_ctx *ctx, int fd, unsigned short events,
10941094
dlen = (size_t)len;
10951095
if (dlen < sizeof(psm)) {
10961096
errno = EINVAL;
1097-
return -1;
1097+
goto stop;
10981098
}
10991099

11001100
if (psm.ps_cmd == PS_STOP) {
@@ -1123,12 +1123,12 @@ ps_recvpsmsg(struct dhcpcd_ctx *ctx, int fd, unsigned short events,
11231123
if (dlen != 0) {
11241124
if (dlen > sizeof(ps_data)) {
11251125
errno = EMSGSIZE;
1126-
return -1;
1126+
goto stop;
11271127
}
11281128
len = recv(fd, ps_data, dlen, MSG_WAITALL);
11291129
if ((size_t)len != dlen) {
11301130
errno = EINVAL;
1131-
return -1;
1131+
goto stop;
11321132
}
11331133
}
11341134

0 commit comments

Comments
 (0)