ntdll/unix: Zero-extend IP_TOS byte to INT.

The IP_TOS control data is 1 byte on Unix, but 4 bytes on Windows.
Properly zero-extend the value instead of copying 3 bytes of garbage.

Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jinoh Kang 2022-01-19 04:27:37 +09:00 committed by Alexandre Julliard
parent 792546f612
commit 938783cac9
1 changed files with 2 additions and 1 deletions

View File

@ -429,8 +429,9 @@ static int convert_control_headers(struct msghdr *hdr, WSABUF *control)
#if defined(IP_TOS)
case IP_TOS:
{
INT tos = *(unsigned char *)CMSG_DATA(cmsg_unix);
ptr = fill_control_message( WS_IPPROTO_IP, WS_IP_TOS, ptr, &ctlsize,
CMSG_DATA(cmsg_unix), sizeof(INT) );
&tos, sizeof(INT) );
if (!ptr) goto error;
break;
}