Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3323654imu; Sun, 11 Nov 2018 12:22:30 -0800 (PST) X-Google-Smtp-Source: AJdET5c+d4vZcaDVX9KOpPnYuCSIo89Sg3YNZaV5f1DoRehEvOuFaFKYIei7uwR24tR8icjl7r8U X-Received: by 2002:a63:61c8:: with SMTP id v191mr15220254pgb.242.1541967750589; Sun, 11 Nov 2018 12:22:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541967750; cv=none; d=google.com; s=arc-20160816; b=D61Gk6KhvPkZacr3C9eU3pX5EaJcHd+pWn3F2kpWoG66wkx4JTKfH9YNBHnbHM1Sot ygvnPwKRiszyNlmaW2/yakTn3GJJTOGirHqFYpXC0bGFL0N4IAXrhwPIDsZ+cdRFfys3 xj9l9NEtDn2FyFHD1TrISvt+67MuD6j78A+xRjjSk6NE807qk/TnAXEFKjcz/XEju5fy AQWfanAvY1/VnvNzMECuqATHqM8Yv5L96IZd0Q6L0fSiaOjMviCQEKUOzV/Ii0POfyfR UV5i9WYwkrimSB3OLL0DkKxx8wLGslYUrLqPrzyKNBVrM8TNclg0dTXZ1vnAcx5Fp3BS L22w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=Zx4O5+uyJYEhKgcsTktvtK7tcMdAf+PQfKBtkkho9UQ=; b=a+8GCx7cwfbIRN/xS1fHejPV4WD5qS9sgo9sVAe7KNnHdObP9N7BOhoJbXX3iZjAfv qR1T1d9LIU4ERHQ3BLgwr9pL3G0ye6BBJcNM276TD0DtX97+vLUgHVrM88ge/cQw5nji sxVwqKo8MunMfCQyn3iHu9X9DRFef2j2+JQ2G0SrcTc/OuD3bDpBrELMCgmXnIzHUYRR cbslxHFaLdNO1iUABCZUL3aj9He2iOx6ddh/9H71f8aKOnZLt8XfEoDLsVRHWr/Htqt2 7bYREeZ29+GPiUjDWPMhqZSoyOFylBKJz/10kRsI0F8B+wjsDZEteYMsmV4z6Z9kCQ0o HPHA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b12-v6si15029505plr.175.2018.11.11.12.22.15; Sun, 11 Nov 2018 12:22:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731651AbeKLGJo (ORCPT + 99 others); Mon, 12 Nov 2018 01:09:44 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:53456 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726652AbeKLGJn (ORCPT ); Mon, 12 Nov 2018 01:09:43 -0500 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gLvt4-0000l5-39; Sun, 11 Nov 2018 19:59:14 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gLvsR-0001W6-8U; Sun, 11 Nov 2018 19:58:35 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Nathan Chancellor" , "Masahiro Yamada" Date: Sun, 11 Nov 2018 19:49:05 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 115/366] kconfig: Avoid format overflow warning from GCC 8.1 In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.61-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Nathan Chancellor commit 2ae89c7a82ea9d81a19b4fc2df23bef4b112f24e upstream. In file included from scripts/kconfig/zconf.tab.c:2485: scripts/kconfig/confdata.c: In function ‘conf_write’: scripts/kconfig/confdata.c:773:22: warning: ‘%s’ directive writing likely 7 or more bytes into a region of size between 1 and 4097 [-Wformat-overflow=] sprintf(newname, "%s%s", dirname, basename); ^~ scripts/kconfig/confdata.c:773:19: note: assuming directive output of 7 bytes sprintf(newname, "%s%s", dirname, basename); ^~~~~~ scripts/kconfig/confdata.c:773:2: note: ‘sprintf’ output 1 or more bytes (assuming 4104) into a destination of size 4097 sprintf(newname, "%s%s", dirname, basename); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ scripts/kconfig/confdata.c:776:23: warning: ‘.tmpconfig.’ directive writing 11 bytes into a region of size between 1 and 4097 [-Wformat-overflow=] sprintf(tmpname, "%s.tmpconfig.%d", dirname, (int)getpid()); ^~~~~~~~~~~ scripts/kconfig/confdata.c:776:3: note: ‘sprintf’ output between 13 and 4119 bytes into a destination of size 4097 sprintf(tmpname, "%s.tmpconfig.%d", dirname, (int)getpid()); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Increase the size of tmpname and newname to make GCC happy. Signed-off-by: Nathan Chancellor Signed-off-by: Masahiro Yamada Signed-off-by: Ben Hutchings --- scripts/kconfig/confdata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -738,7 +738,7 @@ int conf_write(const char *name) struct menu *menu; const char *basename; const char *str; - char dirname[PATH_MAX+1], tmpname[PATH_MAX+1], newname[PATH_MAX+1]; + char dirname[PATH_MAX+1], tmpname[PATH_MAX+22], newname[PATH_MAX+8]; char *env; dirname[0] = 0;