linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] prism54: call BUG_ON() earlier
@ 2010-07-10  8:53 Dan Carpenter
  2010-07-12 17:06 ` Luis R. Rodriguez
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2010-07-10  8:53 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: John W. Linville, André Goddard Rosa, Jiri Kosina,
	linux-wireless, kernel-janitors

This test is off by one because strlen() doesn't include the NULL
terminator.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/drivers/net/wireless/prism54/isl_ioctl.c b/drivers/net/wireless/prism54/isl_ioctl.c
index 8d1190c..1051268 100644
--- a/drivers/net/wireless/prism54/isl_ioctl.c
+++ b/drivers/net/wireless/prism54/isl_ioctl.c
@@ -2067,7 +2067,7 @@ send_simple_event(islpci_private *priv, const char *str)
 	memptr = kmalloc(IW_CUSTOM_MAX, GFP_KERNEL);
 	if (!memptr)
 		return;
-	BUG_ON(n > IW_CUSTOM_MAX);
+	BUG_ON(n >= IW_CUSTOM_MAX);
 	wrqu.data.pointer = memptr;
 	wrqu.data.length = n;
 	strcpy(memptr, str);

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

end of thread, other threads:[~2010-07-12 17:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-10  8:53 [patch] prism54: call BUG_ON() earlier Dan Carpenter
2010-07-12 17:06 ` Luis R. Rodriguez
2010-07-12 17:37   ` Dan Carpenter
2010-07-12 17:48     ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).