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: In-Reply-To: <51A32D81.2010105@asianux.com> Sender: linux-arch-owner@vger.kernel.org List-Archive: List-Post: 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" List-ID: 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.