FreeBSD Bugzilla – Attachment 176971 Details for
Bug 214488
mqueuefs mq_setattr() leaks stack memory
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Example trigger
test.c (text/x-csrc), 614 bytes, created by
Vlad Tsyrklevich
on 2016-11-13 22:22:50 UTC
(
hide
)
Description:
Example trigger
Filename:
MIME Type:
Creator:
Vlad Tsyrklevich
Created:
2016-11-13 22:22:50 UTC
Size:
614 bytes
patch
obsolete
>// # kldload mqueuefs >// $ cc -o test test.c -lrt && ./test > >#include <stdio.h> >#include <string.h> >#include <stdlib.h> >#include <fcntl.h> >#include <mqueue.h> > >int main(int argc, char *argv[]) >{ > mqd_t mq = mq_open("/foo", O_CREAT | O_RDONLY, 0666, NULL); > if (mq == (mqd_t)-1) { > perror("mq_open"); > exit(1); > } > > struct mq_attr attr; > memset(&attr, 0, sizeof(attr)); > > int retval = mq_setattr(mq, NULL, &attr); > if (retval < 0) { > perror("mq_setattr"); > } > > for (int i = 0; i < sizeof(attr); i++) { > printf("%02x ", ((unsigned char*)&attr)[i]); > if (i % 8 == 7) { > printf("\n"); > } > } > printf("\n"); > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 214488
: 176971