From patchwork Sat Jun 2 16:02:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 10444915 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3E980602BD for ; Sat, 2 Jun 2018 16:01:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2476E28A50 for ; Sat, 2 Jun 2018 16:01:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1866828AA4; Sat, 2 Jun 2018 16:01:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B521728A50 for ; Sat, 2 Jun 2018 16:01:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750964AbeFBQBn (ORCPT ); Sat, 2 Jun 2018 12:01:43 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:37102 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750850AbeFBQBm (ORCPT ); Sat, 2 Jun 2018 12:01:42 -0400 Received: by mail-wr0-f195.google.com with SMTP id d8-v6so7796686wro.4; Sat, 02 Jun 2018 09:01:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rVfF16/5SNC5Fn5fMJu6djBoHHVqmMu78uemfX6Ieyw=; b=oP8gaNyayAV1xXB+5m3AF+2X7WZe1yKLv+SWp6a4CrjOuCXLyXfRi2Sjlo20JkUsjg blBSpMTnN6FjNCIVb4qF+BkBK7MVg7EJlG8qNmH3ElvEfvpNop13GyoD/3JHD43dCDpA gXo/zT0QYcyMbT9+lrO3EQRXiWCu/0ZeGA85nYs9iTlQ8a2eH9VnotrSXAcsAp2CMEwK RaL7wcS/WOftX9OWbT1+JzYLoNIG8tgGte9kf7vfsxQE4mag1gDuMYcg3EadkBvTIhK0 AJMX6OhQPvMBAu4p3iT9nCNgfn4SaIfeWduW/VsqnK6SI8a/JswHU/MYTyQTEQebzjmF J9Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rVfF16/5SNC5Fn5fMJu6djBoHHVqmMu78uemfX6Ieyw=; b=ucAR3cIMmoPhmgmmkkyNGb1ppVR8BrIFIP3mROJgtaN8pZTFRWYOa+zoGOs+pcW6In 274qBhdM4BWhx7ckYPuIGwSVNcZcAM7oZgtk8AzIK7d63M/21K0m7SrZ2R1E0pmF6tmY t0S2n1WMwpen6VGCfSQzIEusRtjiyqcEDOFsTUJxXdY5oeNXsqtZo8RXj81SC12UjBEm uHIjFXQxb5L+T5AICusI1L+m0bMZfCgrUatcJAdIZD5dYvFxIALam9xenNZhx/7PqCFI qE5MFp33UvOM6x5pU8SkVGSPlH557tITuRiWofrZMP0jA5xfSqj5gB5uZId7IwwfsJE4 z94Q== X-Gm-Message-State: ALKqPwdGNx5fSbBW750xtbAOiHsb0U5Fsa7nW1qq08GgGYf2obetHd3A Ypc3VnNm7mZo3IYoEU9wk7w= X-Google-Smtp-Source: ADUXVKL2zjmuczihMZbv+5+TpwawFmuwYRVeZsq+Q1Ytij8UsrsDMcI64UdmEODO/0o2dJunkOUNpw== X-Received: by 2002:adf:ed52:: with SMTP id u18-v6mr10793101wro.262.1527955300920; Sat, 02 Jun 2018 09:01:40 -0700 (PDT) Received: from flashbox.your-server.de ([2a01:4f8:10b:24a5::2]) by smtp.gmail.com with ESMTPSA id a8-v6sm33917699wrc.18.2018.06.02.09.01.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 02 Jun 2018 09:01:40 -0700 (PDT) From: Nathan Chancellor To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Nathan Chancellor , stable@vger.kernel.org Subject: [PATCH] kconfig: Avoid format overflow warning from GCC 8.1 Date: Sat, 2 Jun 2018 09:02:09 -0700 Message-Id: <20180602160209.23605-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. Cc: stable@vger.kernel.org Signed-off-by: Nathan Chancellor --- scripts/kconfig/confdata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index 5f87ad561b08..39e20974f4a3 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -720,7 +720,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;