From patchwork Mon Aug 19 06:43: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: 171583 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp2570242ily; Sun, 18 Aug 2019 23:43:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqxcukizUq9v/xo+jizoP5wFHXlgxhU1L172TeTNG35tboe6zwbnvXiM+TPxRAN6R3fBgr9l X-Received: by 2002:a62:7e11:: with SMTP id z17mr21943355pfc.211.1566196994206; Sun, 18 Aug 2019 23:43:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566196994; cv=none; d=google.com; s=arc-20160816; b=CBvegergfZUtw3BuV8zCSiLIE4fP/725oDJ5WVo6yny5efYf1iSc98mTgZjys7EPrO iFaC2WWaxmOdhhc0C5UeSsLqpuo1yl/Zxhg9U0g6Y4FKhiidmjrZWYIkg+VKx55/Z/VW E7wiO9PnV8+mq/zQaRlLRf9ISwF9v10nMs12QOkSnKMbGnkwGvs9xhdpUSmtIR63ivJ9 e6oeIxjzw0VO4AIHvzbsXr7dUHR2Hd5CiksBvqQqMIg21BOHj1LNzHoshc2tBIXe6jyq Y6ElN1Eh0wGLAhln8eolEdAPIcsSGbHzRUEBQuDzLf2uMLg0g4BCMK8YJVnL4+yi7Cuu ntPw== 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=IFUE4UjM2HPc3b0pijYzVzXeqo7RTX7pT8IMpfJyhBAcJoiNzguc34EtX2N7BKdaYf nGhzqlVIteW7oJt/4hNR8Jkjq3Yhk0VOm/NAkylF04Fr8xMRRDK4yzxATFdHxAI7xF0T EEedlzlmali8l5Le9h6tRQyJweXUXaTy3lNAyRFlAYvNItbmrt6VLQ4vI0/o+Tj+iZOT MUYbnHzPYTF4e7uo3HTKVgOk5PQRYVxa5pqszPeTtDsahJ9GF7DXxukWOAUZhWBvDLTM sBhdnnFvtcDQFry5O6kmiUGK14PqRKzGitnspDZVdjYqNLNN/pRV+nVOp9jkwadKlBSk CbDw== 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 v33si9200842pgk.152.2019.08.18.23.43.14; Sun, 18 Aug 2019 23:43:14 -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 S1726768AbfHSGnN (ORCPT + 3 others); Mon, 19 Aug 2019 02:43:13 -0400 Received: from mail.monom.org ([188.138.9.77]:33102 "EHLO mail.monom.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726751AbfHSGnM (ORCPT ); Mon, 19 Aug 2019 02:43:12 -0400 Received: from mail.monom.org (localhost [127.0.0.1]) by filter.mynetwork.local (Postfix) with ESMTP id 3DA3B5007F3; Mon, 19 Aug 2019 08:43:11 +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 155CE5007D2; Mon, 19 Aug 2019 08:43:11 +0200 (CEST) From: Daniel Wagner To: Clark Williams , John Kacur Cc: linux-rt-users@vger.kernel.org, Daniel Wagner Subject: [PATCH rt-tests v1 v1 4/4] deadline_test: Increase buffer to avoid overflow Date: Mon, 19 Aug 2019 08:43:04 +0200 Message-Id: <20190819064304.4676-5-wagi@monom.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190819064304.4676-1-wagi@monom.org> References: <20190819064304.4676-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 Signed-off-by: John Kacur 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);