From: Takashi Iwai Subject: Re: [PATCH v2 1/7] ALSA: als100: fix format string overflow warning Date: Tue, 18 Jul 2017 18:00:01 +0200 Message-ID: References: <20170718114820.3681255-1-arnd@arndb.de> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id D8A7D266C4D for ; Tue, 18 Jul 2017 18:00:02 +0200 (CEST) In-Reply-To: <20170718114820.3681255-1-arnd@arndb.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Arnd Bergmann Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org List-Id: alsa-devel@alsa-project.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