All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] s390: Fix wrong size in memcmp (netiucv)
@ 2011-01-29 21:33 Stefan Weil
  2011-01-29 21:33 ` [PATCH 2/2] s390: Fix possibly wrong size in strncmp (smsglucv) Stefan Weil
  2011-01-31 10:37 ` [PATCH 1/2] s390: Fix wrong size in memcmp (netiucv) Ursula Braun
  0 siblings, 2 replies; 8+ messages in thread
From: Stefan Weil @ 2011-01-29 21:33 UTC (permalink / raw)
  To: linux390
  Cc: Stefan Weil, Ursula Braun, Frank Blaschka, Martin Schwidefsky,
	Heiko Carstens, linux-s390, linux-kernel

This error was reported by cppcheck:
drivers/s390/net/netiucv.c:568: error: Using sizeof for array given as function argument returns the size of pointer.

sizeof(ipuser) did not result in 16 (as many programmers would have
expected) but sizeof(u8 *), so it is 4 or 8, too small here.

Cc: Ursula Braun <ursula.braun@de.ibm.com>
Cc: linux390@de.ibm.com
Cc: Frank Blaschka <blaschka@linux.vnet.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: linux-s390@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
 drivers/s390/net/netiucv.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c
index 65ebee0..b6a6356 100644
--- a/drivers/s390/net/netiucv.c
+++ b/drivers/s390/net/netiucv.c
@@ -565,7 +565,7 @@ static int netiucv_callback_connreq(struct iucv_path *path,
 	struct iucv_event ev;
 	int rc;
 
-	if (memcmp(iucvMagic, ipuser, sizeof(ipuser)))
+	if (memcmp(iucvMagic, ipuser, 16))
 		/* ipuser must match iucvMagic. */
 		return -EINVAL;
 	rc = -EINVAL;
-- 
1.7.2.3


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

end of thread, other threads:[~2011-01-31 10:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-29 21:33 [PATCH 1/2] s390: Fix wrong size in memcmp (netiucv) Stefan Weil
2011-01-29 21:33 ` [PATCH 2/2] s390: Fix possibly wrong size in strncmp (smsglucv) Stefan Weil
2011-01-29 21:38   ` Jesper Juhl
2011-01-29 22:08     ` Andreas Schwab
2011-01-29 23:00     ` Stefan Weil
2011-01-30 12:01       ` Geert Uytterhoeven
2011-01-31 10:44   ` Ursula Braun
2011-01-31 10:37 ` [PATCH 1/2] s390: Fix wrong size in memcmp (netiucv) Ursula Braun

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.