From patchwork Sat Jul 10 08:53:38 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 111218 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6A8tGQj023078 for ; Sat, 10 Jul 2010 08:55:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752049Ab0GJIzO (ORCPT ); Sat, 10 Jul 2010 04:55:14 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:40313 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751511Ab0GJIzM (ORCPT ); Sat, 10 Jul 2010 04:55:12 -0400 Received: by fxm14 with SMTP id 14so1532098fxm.19 for ; Sat, 10 Jul 2010 01:55:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=N4aEAcWYVHzCgZr8MKoaS1sbJbr9urOmbSpaNJ4SqOw=; b=lf+oFCL8yKvO7wojrf7iTbR3SPUWoyK5jtPbxXHilngDWs5Tw2CU4TR5FqfrLKmFbw P3YqCabqslWhmei6S7UmMjegkg1tQnr1hdxxuc41zVJt3bFYFwXurZIC1DJt/3FiT0pM RRgYjd2ivxdis0zbcQs/YH6Os64fktrMNBFp8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=jsfr0bC1nX1T9l+c93x4+NZPM8iL0tYfHfWnwc4Ej4DwXmGncK4rg2A3zzJw24tcOt o+rv2QydXzFO/V09F/3pBYgqv21myJ7efb8s3oKOABByzRME7C4qFwwqvXDyGh5LoVF8 aqn/FdRXmG9BRj7RwvPiRlQr+WBaraaG67hFc= Received: by 10.223.123.211 with SMTP id q19mr9267400far.63.1278752110649; Sat, 10 Jul 2010 01:55:10 -0700 (PDT) Received: from bicker ([205.177.176.130]) by mx.google.com with ESMTPS id b14sm3847717fab.19.2010.07.10.01.55.03 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 10 Jul 2010 01:55:09 -0700 (PDT) Date: Sat, 10 Jul 2010 10:53:38 +0200 From: Dan Carpenter To: "Luis R. Rodriguez" Cc: "John W. Linville" , =?iso-8859-1?Q?Andr=E9?= Goddard Rosa , Jiri Kosina , linux-wireless@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] prism54: call BUG_ON() earlier Message-ID: <20100710085338.GQ19184@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sat, 10 Jul 2010 08:55:25 +0000 (UTC) This test is off by one because strlen() doesn't include the NULL terminator. Signed-off-by: Dan Carpenter --- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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);