candump: reserve enough space for ctrlmsg
The ctrlmsg must be large enough to contains 3 elements of various sizes, not a single element of the sum of the size. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>pull/376/head
parent
0d26ba9ea3
commit
2b5e93744b
|
|
@ -303,7 +303,9 @@ int main(int argc, char **argv)
|
|||
int join_filter;
|
||||
char *ptr, *nptr;
|
||||
struct sockaddr_can addr;
|
||||
char ctrlmsg[CMSG_SPACE(sizeof(struct timeval) + 3 * sizeof(struct timespec) + sizeof(__u32))];
|
||||
char ctrlmsg[CMSG_SPACE(sizeof(struct timeval)) +
|
||||
CMSG_SPACE(3 * sizeof(struct timespec)) +
|
||||
CMSG_SPACE(sizeof(__u32))];
|
||||
struct iovec iov;
|
||||
struct msghdr msg;
|
||||
struct cmsghdr *cmsg;
|
||||
|
|
|
|||
Loading…
Reference in New Issue