public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] s390/dis: Fix invalid array size
@ 2013-02-24 22:15 Syam Sidhardhan
  2013-02-25  6:52 ` Heiko Carstens
  0 siblings, 1 reply; 2+ messages in thread
From: Syam Sidhardhan @ 2013-02-24 22:15 UTC (permalink / raw)
  To: schwidefsky, heiko.carstens, linux390, borntraeger, jang,
	linux-s390
  Cc: linux-kernel, syamsidhardh

We are using sizeof operator for an array given as function argument,
which is incorrect.

Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
---
 arch/s390/kernel/dis.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/s390/kernel/dis.c b/arch/s390/kernel/dis.c
index c50665f..3ad5e95 100644
--- a/arch/s390/kernel/dis.c
+++ b/arch/s390/kernel/dis.c
@@ -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);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] s390/dis: Fix invalid array size
  2013-02-24 22:15 [PATCH] s390/dis: Fix invalid array size Syam Sidhardhan
@ 2013-02-25  6:52 ` Heiko Carstens
  0 siblings, 0 replies; 2+ messages in thread
From: Heiko Carstens @ 2013-02-25  6:52 UTC (permalink / raw)
  To: Syam Sidhardhan
  Cc: schwidefsky, linux390, borntraeger, jang, linux-s390,
	linux-kernel

On Mon, Feb 25, 2013 at 03:45:45AM +0530, Syam Sidhardhan wrote:
> We are using sizeof operator for an array given as function argument,
> which is incorrect.
> 
> Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
> ---
>  arch/s390/kernel/dis.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/s390/kernel/dis.c b/arch/s390/kernel/dis.c
> index c50665f..3ad5e95 100644
> --- a/arch/s390/kernel/dis.c
> +++ b/arch/s390/kernel/dis.c
> @@ -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]]);

Thanks, applied.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-02-25  6:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-24 22:15 [PATCH] s390/dis: Fix invalid array size Syam Sidhardhan
2013-02-25  6:52 ` Heiko Carstens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox