From patchwork Sat Sep 4 18:33:03 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 63800 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47647B710B for ; Sun, 5 Sep 2010 04:34:19 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752233Ab0IDSeJ (ORCPT ); Sat, 4 Sep 2010 14:34:09 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:47294 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751787Ab0IDSeI (ORCPT ); Sat, 4 Sep 2010 14:34:08 -0400 Received: by bwz11 with SMTP id 11so2410312bwz.19 for ; Sat, 04 Sep 2010 11:34:06 -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=wMl0hJWupuc5rXa8+JG4ByC4S/Av9XVYeeHqmaTbStE=; b=Rmmiwpv/ohVe4ImiW2pxrBiEi1Y7yLZ46PsF1amNt2Al6XeZfRryi0N6Oi3piQe0UO 1LvyexS1MNc1MgnfLGD8ZeDFSk/KmtHM7N9gcwugzSNoUK31yqyAYjwRPrkgWqrcNo+G mT7CxiSbuT4IEnz2MOd6qsX3dUE+b0Gh4o2/8= 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=xH8gURHuoFX759BE9fFu8HJTu8MBjGn18A4jZYQQS1tsAiaA6ZkcvJVQhS9eqLpfP7 ZQexDdp+5qvo7zu/Gbkwgorp48LQo+4tRTcV2MaWPzUxHLT9ZefSdsb28GL/cSK3UXiZ sJWH4MYCIzVrXuRr5lpCZuPnRPKcAwhThwTZg= Received: by 10.204.112.129 with SMTP id w1mr1411401bkp.204.1283625246846; Sat, 04 Sep 2010 11:34:06 -0700 (PDT) Received: from bicker ([205.177.176.130]) by mx.google.com with ESMTPS id x13sm2630844bki.12.2010.09.04.11.33.51 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 04 Sep 2010 11:34:05 -0700 (PDT) Date: Sat, 4 Sep 2010 20:33:03 +0200 From: Dan Carpenter To: Karsten Keil Cc: "David S. Miller" , Tilman Schmidt , netdev@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] isdn: cleanup: make buffer smaller Message-ID: <20100904183303.GN5437@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This showed up in my audit because we use strcpy() to copy "ds" into a 32 character buffer inside the isdn_tty_dial() function. But it turns out that we only ever use the first 32 characters so it's OK. I have changed the declaration to make the static checkers happy. Signed-off-by: Dan Carpenter --- To unsubscribe from this list: send the line "unsubscribe netdev" 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/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c index 51dc60d..f013ee1 100644 --- a/drivers/isdn/i4l/isdn_tty.c +++ b/drivers/isdn/i4l/isdn_tty.c @@ -3515,7 +3515,7 @@ isdn_tty_parse_at(modem_info * info) { atemu *m = &info->emu; char *p; - char ds[40]; + char ds[ISDN_MSNLEN]; #ifdef ISDN_DEBUG_AT printk(KERN_DEBUG "AT: '%s'\n", m->mdmcmd); @@ -3594,7 +3594,7 @@ isdn_tty_parse_at(modem_info * info) break; case '3': p++; - sprintf(ds, "\r\n%d", info->emu.charge); + snprintf(ds, sizeof(ds), "\r\n%d", info->emu.charge); isdn_tty_at_cout(ds, info); break; default:;