Sourceware Bugzilla – Attachment 6077 Details for
Bug 13446
crash in vfprintf with more than 64 format args and format specifiers (CVE-2012-3405)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
testcase
mtest.c (text/x-csrc), 1.86 KB, created by
Rich Coe
on 2011-11-29 03:37:22 UTC
(
hide
)
Description:
testcase
Filename:
MIME Type:
Creator:
Rich Coe
Created:
2011-11-29 03:37:22 UTC
Size:
1.86 KB
patch
obsolete
>#include <stdio.h> >#include <stdlib.h> >#include <string.h> >#include <printf.h> > >#ifndef LIBDIR >#define LIBDIR "/usr/lib/X11" >#endif >#ifndef INCDIR >#define INCDIR "/usr/include/X11" >#endif > >static char PATH_DEFAULT[] = "\ >%%P\ >%%S:\ >%s/%%L/%%T/%%N/%%P\ >%%S:\ >%s/%%l_%%t/%%T/%%N/%%P\ >%%S:\ >%s/%%l/%%T/%%N/%%P\ >%%S:\ >%s/%%T/%%N/%%P\ >%%S:\ >%s/%%L/%%T/%%P\ >%%S:\ >%s/%%l_%%t/%%T/%%P\ >%%S:\ >%s/%%l/%%T/%%P\ >%%S:\ >%s/%%T/%%P\ >%%S:\ >%s/%%P\ >%%S:\ >%s/%%L/%%T/%%N/%%P\ >%%S:\ >%s/%%l_%%t/%%T/%%N/%%P\ >%%S:\ >%s/%%l/%%T/%%N/%%P\ >%%S:\ >%s/%%T/%%N/%%P\ >%%S:\ >%s/%%L/%%T/%%P\ >%%S:\ >%s/%%l_%%t/%%T/%%P\ >%%S:\ >%s/%%l/%%T/%%P\ >%%S:\ >%s/%%T/%%P\ >%%S:\ >%s/%%T/%%P\ >%%S"; > >static char libdir[] = LIBDIR; >static char incdir[] = INCDIR; > ># include <sys/param.h> ># define MAX_DIR_PATH_LEN MAXPATHLEN > >int >jconv(FILE *stream, const struct printf_info *info, const void *const *args) >{ > int ival1, ival2; > char *buf; > int len; > > ival1 = *((int *) (args[0])); > ival2 = *((int *) (args[1])); > len = asprintf(&buf, "<j format> %d:%d", ival1, ival2); > if (-1 == len) > return -1; > len = fprintf(stream, "%s", buf); > free(buf); > return len; >} > >int >jinfo(const struct printf_info *info, size_t n, int *argtypes) >{ > if (n > 0) { > argtypes[0] = PA_INT; > argtypes[1] = PA_INT; > } > return 2; >} > >void >main(int argc, char **argv) >{ > char stackString[MAX_DIR_PATH_LEN]; > char * homedir = stackString ; > char *path; > > register_printf_function('j', jconv, jinfo); > > homedir = (char *) getenv ("HOME"); > > path = calloc(1, (9*strlen(homedir) + strlen(PATH_DEFAULT) + 8*strlen(libdir) + strlen(incdir) + 1)); > sprintf(path, PATH_DEFAULT, homedir, homedir, homedir, > homedir, homedir, homedir, homedir, homedir, homedir, > libdir, libdir, libdir, libdir, libdir, libdir, libdir, > libdir, incdir); > > printf("path set %s\n", path); >}
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 13446
: 6077 |
6078