Commit 584236ac authored by Magnus Damm's avatar Magnus Damm Committed by Linus Torvalds

[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: default avatarMagnus Damm <magnus@valinux.co.jp>
Cc: Daniel Jacobowitz <drow@false.org>
Cc: Roland McGrath <roland@redhat.com>
Cc: Jakub Jelinek <jakub@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 386d9a7e
...@@ -1009,7 +1009,7 @@ static int notesize(struct memelfnote *en) ...@@ -1009,7 +1009,7 @@ static int notesize(struct memelfnote *en)
int sz; int sz;
sz = sizeof(struct elf_note); sz = sizeof(struct elf_note);
sz += roundup(strlen(en->name), 4); sz += roundup(strlen(en->name) + 1, 4);
sz += roundup(en->datasz, 4); sz += roundup(en->datasz, 4);
return sz; return sz;
...@@ -1028,7 +1028,7 @@ static int writenote(struct memelfnote *men, struct file *file) ...@@ -1028,7 +1028,7 @@ static int writenote(struct memelfnote *men, struct file *file)
{ {
struct elf_note en; struct elf_note en;
en.n_namesz = strlen(men->name); en.n_namesz = strlen(men->name) + 1;
en.n_descsz = men->datasz; en.n_descsz = men->datasz;
en.n_type = men->type; en.n_type = men->type;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment