mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-02 08:34:20 +08:00
s390/dis: Fix invalid array size
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>
This commit is contained in:
parent
d12a297038
commit
db7760ad9b
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user