From nobody Thu Nov 10 05:37:33 2022 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4N79b55zvKz4f08f for ; Thu, 10 Nov 2022 05:37:37 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4N79b157TMz4DXV for ; Thu, 10 Nov 2022 05:37:33 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668058653; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e0TYs2GNm/AxTPxWfRD8hcoyQ0AQdX/WszKTUFwULKk=; b=N7wMZkGT/COHMXjAjc3A5NMh/voQs2qHXJ0KKNGJGcyBKy59SO0afSABn6/q7VpQcNIcwO 1/mzjhSXa1ZkJO1wQb1dkR3hmDEtx+eYMk1XlnL33/jgzEGrv+L7ASIFrc2wiYkqkEqzjn 0soJYn8z/uuia9PoAxxpj15l1YLjHNBc3OFk+o+LZKq4TMpe3N/TlgETqLWi0PIVpYPR8L VuUNIbofe7S7cwoguh1w1l6FzdeQint6dxbUhH19aMBDV4U2uf30DhOHXtTuFJ9U9Fx3nZ GtJoGgZlsxpaCFofm+O7qSFVUJ0SlvhlYk3KPBPx197ohb5YmHgZB+3b9Hd4LA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668058653; a=rsa-sha256; cv=none; b=kYpYSXk9HAPYsEFUFMWlN8oCEDLexILl77NW9vZFbgbc8SmAtTHXK8Xby/LgHoS/i7asWF aJgFnGGWDkrP7TidUt3/ipTRlcDix7S20g48WCZUpIbcx5zpHjhCJGNvukYfMr3u42ioSO 2MV2E4IalRCBIb812eGzBh/rUDD+Rm0z6JFXetrjmUh3Sga7TmiOEMeVI4Favnl4yjJk6E nLePKSqaDWs5+ct7T1H7NzzCKhpGDpiDMme8mEHe27P/ardxwHUm8Q//n2xSvfSJgS/eIj 8gsv6vyDMwmeeSKHPDc8aJyn1XuDS4nGvFJLLvTdVY/yDh1vSz0JYpESsCS3OA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4N79b145JxzqBJ for ; Thu, 10 Nov 2022 05:37:33 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 2AA5bXHB091616 for ; Thu, 10 Nov 2022 05:37:33 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 2AA5bXcW091615 for bugs@FreeBSD.org; Thu, 10 Nov 2022 05:37:33 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 267684] ministat segmentation fault Date: Thu, 10 Nov 2022 05:37:33 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: keen.sand4331@fastmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D267684 Bug ID: 267684 Summary: ministat segmentation fault Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: keen.sand4331@fastmail.com [Noticed in the OpenBSD port.] $ printf "0\n0\n0\n" | ministat - - Segmentation fault (core dumped) The problem is [in ministat.c] at line 646: nds =3D argc; for (i =3D 0; i < nds; i++) { setfilenames[i] =3D argv[i]; if (!strcmp(argv[i], "-")) ----> setfiles[0] =3D stdin; else setfiles[i] =3D fopen(argv[i], "r"); if (setfiles[i] =3D=3D NULL) err(2, "Cannot open %s", argv[i]); } The simplest fix is just to change that to: setfiles[i] =3D stdin; With that in place, ministat will error out reporting that (on second reading) the input has fewer than 3 data points. --=20 You are receiving this mail because: You are the assignee for the bug.=