From patchwork Fri Aug 16 06:42:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 171465 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp448310ily; Thu, 15 Aug 2019 23:42:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqwf2Pk70jwoYCKSWU0l0vZX2grUUu7/xEYIWpcriqZAlVNa3NuCRkaiGmuGyZRAq8KXaQRh X-Received: by 2002:a17:90a:30ad:: with SMTP id h42mr5649611pjb.31.1565937745606; Thu, 15 Aug 2019 23:42:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565937745; cv=none; d=google.com; s=arc-20160816; b=A7/dPZmtHRlfS7VDfCl4VC29nKC4KjK+Lvsuh0Qe0ZTNjmFcSvXewQ4K0OD8TjmAmL i+wYPXSlRWma2qucL549dUEVbX69fH4kmLRV5eNQzNOczXPZGIDw+9pgVJXIRd3ferYV plXEslNRq6lc35RQUWTLDGxKdiCgbhmXIMWALmhCYIqAczUUrz1IEiyJwX8wgffOWfdl wwqEJoWF9GGz/KsyH0tsIboTXBP2ib5ajXMocoaxFJod/6FlFAx1INs6RafBWQIbFY7q EoeA7eseWy4r6a+ScD12ca9cRcbIhgJj6fN4B25f26DcxXcwSTvnG8bt+SKoBOp1/7Ra BTxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=JhOYt1tFwnNbYqQA0ePoY1HjYywF652HdBvGQIrW3X0=; b=v4DlGD/FwIdqhcGMmDiXbD30rJNa9YaB49IuxE1/KKxQOR5hNmI/Vv0KJA9H4+3Jtc M7IRtTku/OiHhOlyIZeIeKKvfGABoFqeddopnPmh2o+LgzeM1viuTKPquovDbjInSW+E WbsIIHzxE7cl5FAKGCtkonVVxon99QXzxMRI8DpdTx3pf+tziGuVwJkeqRtro5ZPbVG6 kEbwJq3SbL3v9rl5oU7cdj0EIg+pnTiUH8pVvDKgzKnj+vPwRZYzSb9UoZcMiuEehpe4 /Cvfocbv7fDxZyVw4GApPNwgK+Oti1+ctyqUEA4kBTc8MIKBw9y61v86+ib049SD2SO3 E6GQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-rt-users-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-rt-users-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=monom.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i18si3807495pfq.58.2019.08.15.23.42.25; Thu, 15 Aug 2019 23:42:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-rt-users-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-rt-users-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-rt-users-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=monom.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726910AbfHPGmY (ORCPT + 3 others); Fri, 16 Aug 2019 02:42:24 -0400 Received: from mail.monom.org ([188.138.9.77]:52498 "EHLO mail.monom.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726841AbfHPGmX (ORCPT ); Fri, 16 Aug 2019 02:42:23 -0400 Received: from mail.monom.org (localhost [127.0.0.1]) by filter.mynetwork.local (Postfix) with ESMTP id 73CF25009BC; Fri, 16 Aug 2019 08:42:22 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.monom.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (b9168f76.cgn.dg-w.de [185.22.143.118]) by mail.monom.org (Postfix) with ESMTPSA id 28A1950093C; Fri, 16 Aug 2019 08:42:22 +0200 (CEST) From: Daniel Wagner To: Clark Williams , John Kacur Cc: linux-rt-users@vger.kernel.org, Daniel Wagner Subject: [PATCH rt-tests v0 4/4] deadline_test: Increase buffer to avoid overflow Date: Fri, 16 Aug 2019 08:42:04 +0200 Message-Id: <20190816064204.6339-5-wagi@monom.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190816064204.6339-1-wagi@monom.org> References: <20190816064204.6339-1-wagi@monom.org> MIME-Version: 1.0 Sender: linux-rt-users-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org Increase the size of the char buffer. gcc 9.1.1 reports: src/sched_deadline/deadline_test.c:1803:24: warning: ‘%d’ directive writing between 1 and 11 bytes into a region of size 10 [-Wformat-overflow=] 1803 | sprintf(setcpu_buf, "%d", cpu_count - 1); | ^~ src/sched_deadline/deadline_test.c:1803:23: note: directive argument in the range [-2147483648, 2147483646] 1803 | sprintf(setcpu_buf, "%d", cpu_count - 1); | ^~~~ src/sched_deadline/deadline_test.c:1803:3: note: ‘sprintf’ output between 2 and 12 bytes into a destination of size 10 1803 | sprintf(setcpu_buf, "%d", cpu_count - 1); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Daniel Wagner --- src/sched_deadline/deadline_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.21.0 diff --git a/src/sched_deadline/deadline_test.c b/src/sched_deadline/deadline_test.c index e2898de328bb..5b5f40dbb74d 100644 --- a/src/sched_deadline/deadline_test.c +++ b/src/sched_deadline/deadline_test.c @@ -1795,7 +1795,7 @@ int main (int argc, char **argv) /* -b has us bind to the last CPU. */ if (!all_cpus && !setcpu) { - setcpu_buf = malloc(10); + setcpu_buf = malloc(12); if (!setcpu_buf) { perror("malloc"); exit(-1);