Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 624012 Details for
Bug 862413
CVE-2012-5195 perl: heap buffer overrun flaw may lead to arbitrary code execution
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
memset wrapper
memset.c (text/plain), 1.61 KB, created by
Petr Pisar
on 2012-10-09 09:27:10 UTC
(
hide
)
Description:
memset wrapper
Filename:
MIME Type:
Creator:
Petr Pisar
Created:
2012-10-09 09:27:10 UTC
Size:
1.61 KB
patch
obsolete
>#include <stdio.h> >#include <stdlib.h> >#include <dlfcn.h> >#include <stdint.h> > >static int check_memset(void *source, int value, size_t count) { > unsigned char *memory = (unsigned char *)source; > unsigned char pattern = (unsigned char)value; > > for (size_t i = 0; i < count; i++) { > if (memory[i] != pattern) { > fprintf(stderr, "memset() did not set byte at offset %zu " > "(%p[%zu]=%u != %u)!\n", i, source, i, memory[i], pattern); > return -1; > } > } > return 0; >} > >static void *real_memset(void *source, int value, size_t count) { >#define LIBRARY "libc.so.6" >#define SYMBOL "memset" > > void *handle; > void *(*function)(void *, int, size_t); > void *retval; > > handle = dlopen(LIBRARY, RTLD_LAZY); > if (NULL == handle) { > fprintf(stderr, "Could not load library %s: %s\n", > LIBRARY, dlerror()); > abort(); > } > > dlerror(); > function = dlsym(handle, SYMBOL); > if (NULL == function) { > fprintf(stderr, "Could not find symbol %s: %s\n", > SYMBOL, dlerror()); > abort(); > } > > retval = (*function)(source, value, count); > if (check_memset(source, value, count)) { > abort(); > } > > if (dlclose(handle)) { > fprintf(stderr, "Could not unload library %s: %s\n", > LIBRARY, dlerror()); > abort(); > } > > return retval; >#undef LIBRARY >#undef SYMBOL >} > >void *memset(void *source, int value, size_t count) { > fprintf(stderr, "Called: memset(source=%p, value=%d, count=%zu)\n", > source, value, count); > return real_memset(source, value, count); >}
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 862413
: 624012 |
624190
|
624842
|
704824