From: Magnus Damm Date: Thu, 7 Dec 2006 04:37:56 +0000 (-0800) Subject: [PATCH] elf: include terminating zero in n_namesz X-Git-Tag: v3.12-rc1~32283^2~14^2~153 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=584236ac7cdddeec0fdff25d2e475471ef91d028;p=kernel%2Fkernel-generic.git [PATCH] elf: include terminating zero in n_namesz The ELF32 spec says we should plus we include the zero on other platforms. Signed-off-by: Magnus Damm Cc: Daniel Jacobowitz Cc: Roland McGrath Cc: Jakub Jelinek Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/mips/kernel/irixelf.c b/arch/mips/kernel/irixelf.c index a82fae2..1bbefbf 100644 --- a/arch/mips/kernel/irixelf.c +++ b/arch/mips/kernel/irixelf.c @@ -1009,7 +1009,7 @@ static int notesize(struct memelfnote *en) int sz; sz = sizeof(struct elf_note); - sz += roundup(strlen(en->name), 4); + sz += roundup(strlen(en->name) + 1, 4); sz += roundup(en->datasz, 4); return sz; @@ -1028,7 +1028,7 @@ static int writenote(struct memelfnote *men, struct file *file) { struct elf_note en; - en.n_namesz = strlen(men->name); + en.n_namesz = strlen(men->name) + 1; en.n_descsz = men->datasz; en.n_type = men->type;