From: Herbert Xu Subject: Re: [PATCH v2 1/2] crypto: Fix -Wstringop-truncation warnings Date: Mon, 9 Jul 2018 00:43:44 +0800 Message-ID: <20180708164344.3lpe6q7m2yjeqcdl@gondor.apana.org.au> References: <20180625124538.21051-1-shorne@gmail.com> <20180625124538.21051-2-shorne@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: LKML , Greg KH , arnd@arndb.de, Eric Biggers , linux-crypto@vger.kernel.org, Max Filippov , Nick Desaulniers , "David S. Miller" To: Stafford Horne Return-path: Content-Disposition: inline In-Reply-To: <20180625124538.21051-2-shorne@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-crypto.vger.kernel.org On Mon, Jun 25, 2018 at 09:45:37PM +0900, Stafford Horne wrote: > As of GCC 9.0.0 the build is reporting warnings like: > > crypto/ablkcipher.c: In function ‘crypto_ablkcipher_report’: > crypto/ablkcipher.c:374:2: warning: ‘strncpy’ specified bound 64 equals destination size [-Wstringop-truncation] > strncpy(rblkcipher.geniv, alg->cra_ablkcipher.geniv ?: "", > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > sizeof(rblkcipher.geniv)); > ~~~~~~~~~~~~~~~~~~~~~~~~~ > > This means the strnycpy might create a non null terminated string. Fix this by > explicitly performing '\0' termination. > > Cc: Greg Kroah-Hartman > Cc: Arnd Bergmann > Cc: Max Filippov > Cc: Eric Biggers > Cc: Nick Desaulniers > Signed-off-by: Stafford Horne Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt