From patchwork Fri Aug 16 06:42:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 171462 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp448280ily; Thu, 15 Aug 2019 23:42:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqwmQ6+8v2duIES6TRuBSOIS0JZjgbZ2uhFZSCBvgxFNRV4LIA/Gzk61OBv4EeaJctE0jQ4O X-Received: by 2002:a63:f91c:: with SMTP id h28mr6116707pgi.397.1565937743271; Thu, 15 Aug 2019 23:42:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565937743; cv=none; d=google.com; s=arc-20160816; b=OkTQ2UPz10iKl66FhQPB4+Op2Ul9eUnx433n2xwhmjBlYfeaUSN35qjGeVhPRWGliT C10IeuGy1B2NvEyZ9GxZmMcNboUwDOGos8No33tNBNqhf/f8IgoPMewCzf7ouQafnNFN 2AtI3GozTT/Whye9u/WwW7+hYB+h36xZcX3we/lykpCWRT09uz15SBhKa7b7xDEId/2V QXWvUSigKnMz4XDodeYD8Nl3CLycBNzkrXcyTqQw03Zkux/8af+UEWlRCeW7kmgTAwJY uEpwRzklaWgfYkFagVI83hD4pAWZz5yW9ZVN5QK6Xr5VLNSahCJ5B+b5nDPsbG2gkpmz UEsQ== 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=tVhVpy1lZNb8KH8z8inPySGXYnMfRsjspWEyVyArKhU=; b=Vez6SgqDLLioNYMg0U7bwRZvoECyT76Ee2kV4/YRg0jTUXlQcuQS4UTCyg7lGucUY1 +brFw+KJNp+FKrfRgWRFxLkgB9k+LogtdpPaCXa4BT2RoFyoh/R0/dzjDpXPtcV+9u77 gdiHWntjv+5uF5inTsqyD7BIXE0nVhOOmk9TPEnjUtOonNz0vBifxadcrFo7PHkBMX6x c3irtoR2RUpx42xHRUorxkSjTsTfSJ4gupICidRUvSrbPbLwCpyeoFonDjQbAfPJ1Wnr z+IiubPmw9Fji1EuqV7+ZGxy5meehSxyrVZXsBNQ0oGU7ALW3w9ecFlBI2/6cDvhCPKZ IC2Q== 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.23; Thu, 15 Aug 2019 23:42:23 -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 S1726816AbfHPGmW (ORCPT + 3 others); Fri, 16 Aug 2019 02:42:22 -0400 Received: from mail.monom.org ([188.138.9.77]:52468 "EHLO mail.monom.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725945AbfHPGmW (ORCPT ); Fri, 16 Aug 2019 02:42:22 -0400 Received: from mail.monom.org (localhost [127.0.0.1]) by filter.mynetwork.local (Postfix) with ESMTP id 9F9DB5006D2; Fri, 16 Aug 2019 08:42:20 +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 79A34500665; Fri, 16 Aug 2019 08:42:20 +0200 (CEST) From: Daniel Wagner To: Clark Williams , John Kacur Cc: linux-rt-users@vger.kernel.org, Daniel Wagner Subject: [PATCH rt-tests v0 1/4] pmqtest: Increase buffer to avoid overflow Date: Fri, 16 Aug 2019 08:42:01 +0200 Message-Id: <20190816064204.6339-2-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/pmqtest/pmqtest.c: In function ‘main’: src/pmqtest/pmqtest.c:46:21: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size 8 [-Wformat-overflow=] 46 | #define SYNCMQ_NAME "/syncmsg%d" | ^~~~~~~~~~~~ src/pmqtest/pmqtest.c:445:3: note: ‘sprintf’ output between 10 and 19 bytes into a destination of size 16 445 | sprintf(mqname, SYNCMQ_NAME, i); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Daniel Wagner --- src/pmqtest/pmqtest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.21.0 diff --git a/src/pmqtest/pmqtest.c b/src/pmqtest/pmqtest.c index a04fc49872bf..20164c8d547f 100644 --- a/src/pmqtest/pmqtest.c +++ b/src/pmqtest/pmqtest.c @@ -440,7 +440,7 @@ int main(int argc, char *argv[]) goto nomem; for (i = 0; i < num_threads; i++) { - char mqname[16]; + char mqname[32]; sprintf(mqname, SYNCMQ_NAME, i); receiver[i].syncmq = mq_open(mqname, oflag, 0777, &mqstat); @@ -567,7 +567,7 @@ int main(int argc, char *argv[]) } nanosleep(&maindelay, NULL); for (i = 0; i < num_threads; i++) { - char mqname[16]; + char mqname[32]; mq_close(receiver[i].syncmq); sprintf(mqname, SYNCMQ_NAME, i);