the opportunity to remove some sprintf-ing into a fixed-sized buffer.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8774
static
void make_elf_coredump(ThreadId tid, const vki_siginfo_t *si, UInt max_size)
{
- Char buf[1000];
+ Char* buf = NULL;
Char *basename = "vgcore";
Char *coreext = "";
Int seq = 0;
if (VG_(clo_log_name) != NULL) {
coreext = ".core";
- basename = VG_(clo_log_name);
+ basename = VG_(expand_file_name)(
+ "--log-file (while creating core filename)",
+ VG_(clo_log_name));
}
+ vg_assert(coreext);
+ vg_assert(basename);
+ buf = VG_(malloc)( "coredump-elf.mec.1",
+ VG_(strlen)(coreext) + VG_(strlen)(basename)
+ + 100/*for the two %ds. */ );
+ vg_assert(buf);
+
for(;;) {
SysRes sres;