From patchwork Sun Jul 4 20:36:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 470040 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp3401425jao; Sun, 4 Jul 2021 13:38:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzB1BPNPbVTOTHm28dYB7Z3pJkQ6MKD2iqxOW2SOvVBLYVY1jgYqhK7Key2FZf/IL6qnaJQ X-Received: by 2002:a05:6402:204:: with SMTP id t4mr12172752edv.34.1625431092163; Sun, 04 Jul 2021 13:38:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625431092; cv=none; d=google.com; s=arc-20160816; b=sXYg80dsl7ZnnVPrtGfdlfDh/H0mrLTl5vhdvWEt5fVGrQv6mVGXfozW+tbBSSJxsX pCa6P4piDPhCKqZw56+OBNCelzP1hHW80qGopTLI6PwGqAhNG+8GC9xSzAS/PmsLY4bA B/S6j69yD19oYODFKlLrDfYRiF/Ks2abz1+SMYjsG79xwgPCfGISl/FjrCGSr4Tk0V74 oN/lO+pj7FkW19YcvzbPGTb1ljZU9kcXJhd8Wsh5EARt9H11q0gBlFZ9W1XXvAAVusMx 0x/6Gy1540sg/5tAbxyBsC8O5C1UyhpIrj+GuTmNWYRnkoGawudWeCt0hGe8pXw3pXaR ad7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Dkypp1P62JpH0H4PIwrFkH6DTmzWpRFtFhQ7x5sWfvA=; b=SsSftECveGfwhtV9vJqc3TGDPRdwL+eYQ9GXrCFDAkXGKXan/bLq/TMYltZKDMAFUP VODz9lDmZQyP792vCTWZj5aVSBi4AcjFmo+0ihaLAiQcg2hPOUiZ8smTEovN4BFdjZgK Q8TwcbZdy4VJYuRphLZOOIQzqJZlAgkFOe+gKR0vM4jRbVdq/V7ygQOr4tJz9t4F07B3 n4XQMZRiJA4bHY9Y9kLb5xZA1sZvQFEgI2qJ0k7EAxhDWq0X6WKBwfjT+xiHF3ZO8mc/ QqTP8i95N7qELyWguWBmCgakB3cYToyQcgfgFI1FjqPsfQc1gxx07awbdtHVlJzlZvaZ ekrQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-rt-users-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id g20si3034453edq.421.2021.07.04.13.38.12; Sun, 04 Jul 2021 13:38:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-rt-users-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-rt-users-owner@vger.kernel.org designates 23.128.96.18 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 S229731AbhGDUkr (ORCPT + 3 others); Sun, 4 Jul 2021 16:40:47 -0400 Received: from mail.monom.org ([188.138.9.77]:39764 "EHLO mail.monom.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229925AbhGDUjH (ORCPT ); Sun, 4 Jul 2021 16:39:07 -0400 Received: from mail.monom.org (localhost [127.0.0.1]) by filter.mynetwork.local (Postfix) with ESMTP id C458B500609; Sun, 4 Jul 2021 22:36:29 +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 (unknown [94.31.98.41]) by mail.monom.org (Postfix) with ESMTPSA id 7E0DA5006B4; Sun, 4 Jul 2021 22:36:29 +0200 (CEST) From: Daniel Wagner To: Clark Williams , John Kacur Cc: linux-rt-users@vger.kernel.org, Daniel Wagner Subject: [PATCH rt-tests v1 3/3] cyclicdeadline: Fix buffer allocation Date: Sun, 4 Jul 2021 22:36:21 +0200 Message-Id: <20210704203621.5612-4-wagi@monom.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210704203621.5612-1-wagi@monom.org> References: <20210704203621.5612-1-wagi@monom.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org From: Daniel Wagner gcc complains with "‘sprintf’ output between 2 and 12 bytes" but the buffer is only 10 bytes long. Update the buffer size to hold the complete range of [-2147483648, 2147483646]. Signed-off-by: Daniel Wagner --- src/sched_deadline/cyclicdeadline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.32.0 diff --git a/src/sched_deadline/cyclicdeadline.c b/src/sched_deadline/cyclicdeadline.c index ffefa9e6fecb..8447424273ee 100644 --- a/src/sched_deadline/cyclicdeadline.c +++ b/src/sched_deadline/cyclicdeadline.c @@ -1092,7 +1092,7 @@ int main(int argc, char **argv) /* Default cpu to use is the last one */ if (!all_cpus && !setcpu) { - setcpu_buf = malloc(10); + setcpu_buf = malloc(12); if (!setcpu_buf) fatal("malloc"); sprintf(setcpu_buf, "%d", cpu_count - 1);