mirror of
https://github.com/crash-utility/crash
synced 2025-02-09 01:46:55 +00:00
Fix for the handling of multiple ramdump images. Without the patch,
entering more than one ramdump image on the command line may result in a segmentation violation. (oza@broadcom.com)
This commit is contained in:
parent
f15a48817f
commit
ffe155026b
@ -64,7 +64,7 @@ static int alloc_program_headers(Elf64_Phdr *phdr)
|
|||||||
unsigned int i;
|
unsigned int i;
|
||||||
struct stat64 st;
|
struct stat64 st;
|
||||||
|
|
||||||
for (i = 0; i < nodes; i++, phdr++) {
|
for (i = 0; i < nodes; i++) {
|
||||||
phdr[i].p_type = PT_LOAD;
|
phdr[i].p_type = PT_LOAD;
|
||||||
|
|
||||||
if (0 > stat64(ramdump[i].path, &st)) {
|
if (0 > stat64(ramdump[i].path, &st)) {
|
||||||
@ -198,8 +198,8 @@ char *ramdump_to_elf(void)
|
|||||||
error(FATAL, "ramdump: unsupported machine type: %s\n",
|
error(FATAL, "ramdump: unsupported machine type: %s\n",
|
||||||
MACHINE_TYPE);
|
MACHINE_TYPE);
|
||||||
|
|
||||||
e_head = (Elf64_Ehdr *)malloc(sizeof(Elf64_Ehdr) +
|
e_head = (Elf64_Ehdr *)malloc(sizeof(Elf64_Ehdr) + sizeof(Elf64_Phdr) +
|
||||||
nodes * sizeof(Elf64_Phdr) + CPY_BUF_SZ * 2);
|
(nodes * sizeof(Elf64_Phdr)) + (CPY_BUF_SZ * 2));
|
||||||
ptr = (char *)e_head;
|
ptr = (char *)e_head;
|
||||||
offset = 0;
|
offset = 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user