From owner-freebsd-hackers@freebsd.org Wed Sep 11 08:28:38 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 588BCF32EE for ; Wed, 11 Sep 2019 08:28:38 +0000 (UTC) (envelope-from sebastian.huber@embedded-brains.de) Received: from dedi548.your-server.de (dedi548.your-server.de [85.10.215.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46Sw5x24dkz4bSs for ; Wed, 11 Sep 2019 08:28:36 +0000 (UTC) (envelope-from sebastian.huber@embedded-brains.de) Received: from sslproxy06.your-server.de ([78.46.172.3]) by dedi548.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1i7xzO-0006TD-VA for freebsd-hackers@freebsd.org; Wed, 11 Sep 2019 10:28:34 +0200 Received: from [82.100.198.138] (helo=mail.embedded-brains.de) by sslproxy06.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1i7xzO-000OU0-Px for freebsd-hackers@freebsd.org; Wed, 11 Sep 2019 10:28:34 +0200 Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 44E042A000F for ; Wed, 11 Sep 2019 10:28:40 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id BSte-B8rvVKt for ; Wed, 11 Sep 2019 10:28:40 +0200 (CEST) Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 041CD2A1682 for ; Wed, 11 Sep 2019 10:28:40 +0200 (CEST) X-Virus-Scanned: amavisd-new at zimbra.eb.localhost Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id VcjrCmfNjnFn for ; Wed, 11 Sep 2019 10:28:39 +0200 (CEST) Received: from linux-diu0.suse (unknown [192.168.96.161]) by mail.embedded-brains.de (Postfix) with ESMTP id DC2A22A000F for ; Wed, 11 Sep 2019 10:28:39 +0200 (CEST) From: Sebastian Huber To: freebsd-hackers@freebsd.org Subject: [PATCH] nvmecontrol: Fix shortopts allocation Date: Wed, 11 Sep 2019 10:28:33 +0200 Message-Id: <20190911082833.32388-1-sebastian.huber@embedded-brains.de> X-Mailer: git-send-email 2.16.4 X-Authenticated-Sender: smtp-embedded@poldinet.de X-Virus-Scanned: Clear (ClamAV 0.101.4/25568/Tue Sep 10 10:25:17 2019) X-Rspamd-Queue-Id: 46Sw5x24dkz4bSs X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of sebastian.huber@embedded-brains.de designates 85.10.215.148 as permitted sender) smtp.mailfrom=sebastian.huber@embedded-brains.de X-Spamd-Result: default: False [-1.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-0.95)[-0.947,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:85.10.215.148]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-0.99)[-0.988,0]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[148.215.10.85.list.dnswl.org : 127.0.10.0]; MID_CONTAINS_FROM(1.00)[]; IP_SCORE(0.13)[ipnet: 85.10.192.0/18(2.46), asn: 24940(-1.78), country: DE(-0.01)]; DMARC_NA(0.00)[embedded-brains.de]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:85.10.192.0/18, country:DE]; RCVD_COUNT_SEVEN(0.00)[8]; HAS_X_AS(0.00)[] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2019 08:28:38 -0000 Account for potential ':' in the short options string. --- sbin/nvmecontrol/comnd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/nvmecontrol/comnd.c b/sbin/nvmecontrol/comnd.c index d8d97ad11b5..a91969ff766 100644 --- a/sbin/nvmecontrol/comnd.c +++ b/sbin/nvmecontrol/comnd.c @@ -189,7 +189,7 @@ arg_parse(int argc, char * const * argv, const struct cmd *f) lopts = malloc((n + 2) * sizeof(struct option)); if (lopts == NULL) err(1, "option memory"); - p = shortopts = malloc((n + 3) * sizeof(char)); + p = shortopts = malloc((2 * n + 2) * sizeof(char)); if (shortopts == NULL) err(1, "shortopts memory"); idx = 0; -- 2.16.4