FreeBSD Bugzilla – Attachment 165469 Details for
Bug 206178
Out-of-bounds read in wcslcat(3)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Crashing testcase
test-wcslcat.c (text/x-csrc), 538 bytes, created by
Alexander Cherepanov
on 2016-01-12 22:43:51 UTC
(
hide
)
Description:
Crashing testcase
Filename:
MIME Type:
Creator:
Alexander Cherepanov
Created:
2016-01-12 22:43:51 UTC
Size:
538 bytes
patch
obsolete
>#include <wchar.h> > >#include <unistd.h> >#include <sys/mman.h> > >int main(void) >{ > size_t size = 10; /* the size of dst */ > > /* dst array */ > long pagesize = sysconf(_SC_PAGESIZE); > char *p = mmap(NULL, 2 * pagesize, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); > if (p == MAP_FAILED) > return 1; > if (mprotect(p + pagesize, pagesize, PROT_NONE) != 0) > return 2; > wchar_t *dst = (wchar_t *)(p + pagesize) - size; > wmemset(dst, L'A', size); > > /* crash here */ > wcslcat(dst, L"", size); > > return 0; >}
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 206178
: 165469 |
165470