Skip to content

Commit

Permalink
[PATCH] elf: include terminating zero in n_namesz
Browse files Browse the repository at this point in the history
The ELF32 spec says we should plus we include the zero on other platforms.

Signed-off-by: Magnus 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: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Magnus Damm authored and Linus Torvalds committed Dec 7, 2006
1 parent 386d9a7 commit 584236a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/mips/kernel/irixelf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down

0 comments on commit 584236a

Please sign in to comment.