From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gerald Schaefer Subject: Re: [PATCH v2] arch: s390: appldata: using strncpy() and strnlen() instead of sprintf() Date: Mon, 27 May 2013 18:23:06 +0200 Message-ID: <20130527182306.3bd8a252@thinkpad> References: <51A2CC07.5010100@asianux.com> <51A32D81.2010105@asianux.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Received: from e06smtp11.uk.ibm.com ([195.75.94.107]:32805 "EHLO e06smtp11.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752526Ab3E0QXO (ORCPT ); Mon, 27 May 2013 12:23:14 -0400 Received: from /spool/local by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 27 May 2013 17:18:40 +0100 In-Reply-To: <51A32D81.2010105@asianux.com> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Chen Gang Cc: Geert Uytterhoeven , Martin Schwidefsky , Heiko Carstens , linux390@de.ibm.com, linux-s390@vger.kernel.org, Linux-Arch , "kernel-janitors@vger.kernel.org" On Mon, 27 May 2013 17:55:13 +0800 Chen Gang wrote: > > 'buf[2]' is 2 bytes length, and sprintf() will append '\0' at the end > of string "?\n", so original implementation is memory overflow. > > Need use strncpy() and strnlen() instead of sprintf(). > > > Signed-off-by: Chen Gang Applied, thanks.