[PATCH 2/7] elf: Increase buf size in get_pt_note_info()

Daniel Kiper daniel.kiper at oracle.com
Fri Jul 12 09:48:10 EDT 2013


get_pt_note_info() always ignores VMCOREINFO_XEN note
because buf size is too small. It does not have place
for \0 char which marks EOS. This patch fixes that bug
and VMCOREINFO_XEN note living in /proc/vmcore file
could be properly detected now.

Signed-off-by: Daniel Kiper <daniel.kiper at oracle.com>
---
 elf_info.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/elf_info.c b/elf_info.c
index 0c1e36a..70a6dd2 100644
--- a/elf_info.c
+++ b/elf_info.c
@@ -310,7 +310,7 @@ get_pt_note_info(void)
 {
 	int n_type, size_name, size_desc;
 	off_t offset, offset_desc;
-	char buf[VMCOREINFO_XEN_NOTE_NAME_BYTES];
+	char buf[VMCOREINFO_XEN_NOTE_NAME_BYTES + 1];
 	char note[MAX_SIZE_NHDR];
 
 	nr_cpus = 0;
-- 
1.7.10.4




More information about the kexec mailing list