Skip to content

Commit

Permalink
s390/dis: Fix invalid array size
Browse files Browse the repository at this point in the history
We are using sizeof operator for an array given as function argument,
which is incorrect.

Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Syam Sidhardhan authored and Martin Schwidefsky committed Feb 28, 2013
1 parent d12a297 commit db7760a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/s390/kernel/dis.c
Original file line number Diff line number Diff line change
Expand Up @@ -1711,10 +1711,10 @@ int insn_to_mnemonic(unsigned char *instruction, char buf[8])
if (!insn)
return -ENOENT;
if (insn->name[0] == '\0')
snprintf(buf, sizeof(buf), "%s",
snprintf(buf, 8, "%s",
long_insn_name[(int) insn->name[1]]);
else
snprintf(buf, sizeof(buf), "%.5s", insn->name);
snprintf(buf, 8, "%.5s", insn->name);
return 0;
}
EXPORT_SYMBOL_GPL(insn_to_mnemonic);
Expand Down

0 comments on commit db7760a

Please sign in to comment.