aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Damm <[email protected]>2006-12-06 20:37:56 -0800
committerLinus Torvalds <[email protected]>2006-12-07 08:39:38 -0800
commit584236ac7cdddeec0fdff25d2e475471ef91d028 (patch)
tree78ddc51de4dde2bd1569d6c6ebfe03aad5cd2b90
parent386d9a7edd9f3492c99124b0a659e9ed7abb30f9 (diff)
[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 <[email protected]> Cc: Daniel Jacobowitz <[email protected]> Cc: Roland McGrath <[email protected]> Cc: Jakub Jelinek <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--arch/mips/kernel/irixelf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/mips/kernel/irixelf.c b/arch/mips/kernel/irixelf.c
index a82fae221ce4..1bbefbf43373 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;