Skip to content

Commit 595c305

Browse files
committed
More minor comments.
1 parent 834a322 commit 595c305

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/privsep-root.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,19 @@ ps_root_readerrorcb(struct psr_ctx *psr_ctx)
131131
/* psr_mdatalen could be smaller then psr_datalen
132132
* if the above malloc failed. */
133133
iov[1].iov_len =
134-
MIN(psr_ctx->psr_mdatalen, psr_ctx->psr_datalen);
134+
MIN(psr_ctx->psr_mdatalen, psr_error->psr_datalen);
135135
} else {
136136
iov[1].iov_base = psr_ctx->psr_data;
137-
iov[1].iov_len = psr_ctx->psr_datalen;
137+
/* This should never be the case */
138+
iov[1].iov_len =
139+
MIN(psr_ctx->psr_datalen, psr_error->psr_datalen);
138140
}
139141
}
140142

141143
recv:
144+
/* fd is SOCK_SEQPACKET and we mark the boundary with MSG_EOR
145+
* so this can never stall if the receive buffers are bigger
146+
* than the actual message. */
142147
len = recvmsg(fd, &msg, MSG_WAITALL);
143148
if (len == -1)
144149
PSR_ERROR(errno);

0 commit comments

Comments
 (0)