From patchwork Mon Aug 19 06:43: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: 171580 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp2570209ily; Sun, 18 Aug 2019 23:43:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqwsQPQCWIEhV9vjmX/M2L9X/mhOrK1asp84PPpUufjE8QvfItByHqc1R9FWEyQA3/QUkwDO X-Received: by 2002:a63:f926:: with SMTP id h38mr18470013pgi.80.1566196992363; Sun, 18 Aug 2019 23:43:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566196992; cv=none; d=google.com; s=arc-20160816; b=E95saKBgVKpAqq64tp/mvlYPaWUIxYQj26ZxSU9jHwnV4YcyclUL5PChspqcqGdfC9 MKq3KkEOtqMS/gbLFzFSJpruzyvBclwtMCAJhmA78kQ+e6QQrjIF1v9wabDJghhSe8zw 7WYRtZ2+mFsF0sWweCoxWkvxLxnymJig+uGkKAXzaew74wgoZGAeML6DicOUTT4PArz9 vNsk+U+3aCgFLZKSv6jmI/wzw/vZz6YG+GHQkhFTYe14jYi6CvIF9Hau/BtUf3LlheVX MxASotGbL9mWxWRcDPgNPQFXKp2QyL5cP2QlKS4oDMQBW2a1aI8VF9jMIdtEH3kJkIYV U3yQ== 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=icRfFopwVUOQqbACKFS2ZIzeZCcPkfVMAVyZ/zKbcns=; b=I7ehyhJCwT196KA1lt/3knmu6EmmGaKTyPuSWXre4mzPuH8g/dujZfcqzK0cw1MMJS 0DYGMgm/3QVpY0QwbjCEA9gaNYx5r2nofrFFBNrIOiC/QY+H9QPqpilHy0g7rWGVH2H7 pG3eejuvgroI9GnVOUFLVS7j3yx7cFmOMszdeVk0z27Gh9HneLr1PpJ9T14D0EQPXPY6 0mFwGox0SU8u6js/Us+onjFDP1BDTn3WW7vSEASPBzr7FArlWVEifo/FUJ7mqALrWgSz zQmQToeVUP3BCdhLdwdZMRproRXcfB2A4y/YOu1RWyEMB+0T2y3WF477bMwgMNrHrG2w jXwQ== 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.12; Sun, 18 Aug 2019 23:43:12 -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 S1726708AbfHSGnL (ORCPT + 3 others); Mon, 19 Aug 2019 02:43:11 -0400 Received: from mail.monom.org ([188.138.9.77]:33084 "EHLO mail.monom.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725790AbfHSGnL (ORCPT ); Mon, 19 Aug 2019 02:43:11 -0400 Received: from mail.monom.org (localhost [127.0.0.1]) by filter.mynetwork.local (Postfix) with ESMTP id BC567500294; Mon, 19 Aug 2019 08:43:09 +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 A3249500797; Mon, 19 Aug 2019 08:43:09 +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 1/4] pmqtest: Increase buffer to avoid overflow Date: Mon, 19 Aug 2019 08:43:01 +0200 Message-Id: <20190819064304.4676-2-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/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 Signed-off-by: John Kacur diff --git a/src/pmqtest/pmqtest.c b/src/pmqtest/pmqtest.c index a04fc49872bf..3ce799bd6319 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[19]; 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[19]; mq_close(receiver[i].syncmq); sprintf(mqname, SYNCMQ_NAME, i);