t_msgctl: Fix the same msgsnd() misuse as t_msgsnd
msgsnd(2)'s msgsz argument does not describe the full structure, only the message component. Reported by: Coverity CIDs: 1368703, 1368711 Sponsored by: Dell EMC Isilon
This commit is contained in:
parent
1a663d3c00
commit
70aca7c8e8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=316181
@ -203,7 +203,7 @@ ATF_TC_BODY(msgctl_pid, tc)
|
||||
|
||||
if (pid == 0) {
|
||||
|
||||
(void)msgsnd(id, &msg, sizeof(struct msg), IPC_NOWAIT);
|
||||
(void)msgsnd(id, &msg, sizeof(msg.buf), IPC_NOWAIT);
|
||||
|
||||
_exit(EXIT_SUCCESS);
|
||||
}
|
||||
@ -314,7 +314,7 @@ ATF_TC_BODY(msgctl_time, tc)
|
||||
t = time(NULL);
|
||||
|
||||
(void)memset(&msgds, 0, sizeof(struct msqid_ds));
|
||||
(void)msgsnd(id, &msg, sizeof(struct msg), IPC_NOWAIT);
|
||||
(void)msgsnd(id, &msg, sizeof(msg.buf), IPC_NOWAIT);
|
||||
(void)msgctl(id, IPC_STAT, &msgds);
|
||||
|
||||
if (llabs(t - msgds.msg_stime) > 1)
|
||||
|
Loading…
Reference in New Issue
Block a user