From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751492AbdGRQAE (ORCPT ); Tue, 18 Jul 2017 12:00:04 -0400 Received: from mx2.suse.de ([195.135.220.15]:56293 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751441AbdGRQAD (ORCPT ); Tue, 18 Jul 2017 12:00:03 -0400 Date: Tue, 18 Jul 2017 18:00:01 +0200 Message-ID: From: Takashi Iwai To: "Arnd Bergmann" Cc: "Jaroslav Kysela" , , Subject: Re: [PATCH v2 1/7] ALSA: als100: fix format string overflow warning In-Reply-To: <20170718114820.3681255-1-arnd@arndb.de> References: <20170718114820.3681255-1-arnd@arndb.de> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.2 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 18 Jul 2017 13:48:04 +0200, Arnd Bergmann wrote: > > The compiler sees that the format string might overflow for the longname: > > sound/isa/als100.c: In function 'snd_als100_pnp_detect': > sound/isa/als100.c:225:27: error: ', dma ' directive writing 6 bytes into a region of size between 0 and 64 [-Werror=format-overflow=] > sprintf(card->longname, "%s, %s at 0x%lx, irq %d, dma %d", > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > sound/isa/als100.c:225:3: note: 'sprintf' output between 24 and 113 bytes into a destination of size 80 > sprintf(card->longname, "%s, %s at 0x%lx, irq %d, dma %d", > > Open-coding "shortname" here gets us below the limit, and using > snprintf() is a good idea too. > > Signed-off-by: Arnd Bergmann Thanks, applied all 7 patches now to for-next branch. Takashi