[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



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@xxxxxxxxxx>
---
 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


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.