From owner-svn-src-all@freebsd.org Thu Oct 3 11:55:29 2019 Return-Path: Delivered-To: svn-src-all@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 C036A13269C; Thu, 3 Oct 2019 11:55:29 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kWfT17zSz419p; Thu, 3 Oct 2019 11:55:28 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-pf1-x441.google.com with SMTP id a2so1598632pfo.10; Thu, 03 Oct 2019 04:55:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:reply-to:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=mx9dwPf1nnqQqthjgnzg6azHfQt034za+zDeFjQ0WHo=; b=C9HqeUi/1xQ+T1U+eX4k8V02+VaNHlgXXSUvaw7BqUTg+UvCbReSGk59PzuE/PM1Hd 0Tpb/TOTIRA5aDcKYfqelA4dRuGUwkvNuVtBktTVfex9eCT0crSlG7lkQjSR+k2i7DOt iHPid/0EoYTBq/zhPZcYOyMtHsy9EVWDXOIHLMhz5RNLbqKQw60HfLc1iQXCIYYfYTf5 atmcbhTSvR+WMJ+vVMWUNOelnamF/GZ5/zW8cQtezfj3NakUVWPFRUYPpzYYBNLG7RVt igz4TP7PoBeLxHyH18PStPapx5YFJHkcOKFxFDvMSg0XSePnG8Zz//LAd5J/F7o58INP mS5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:reply-to:subject:to:cc:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=mx9dwPf1nnqQqthjgnzg6azHfQt034za+zDeFjQ0WHo=; b=NROHP3xJr7Afx6Mg8qWUOBngpgj/elturccadAXzCldzfZYDSFqlrYbcuEYdyYY2iF qZMSEgC+tVWBqn62YdpzEpJTAShsCUOZIP8F7guJCr5/jGxwo8YYEY6cV43HSFtEEJ0x EnpZ8NySIKSrdOlz+hnZxjrv5T037HXsl7fMrntqw7Gc01R+z0NDBKuLdELVlDNzlZFF qljS64EeQ4na5nzRE6Ms7h9j6cBqvxyFFzLeiu8teaa3i3Bw0g6u6E/IxA1PHrUibRNY 3RxV3Ks9oixZMyHUvM894yRSkw6sIGvPVUeyMY/XnPXICi6j/V0U0XNdoOaUs5iDDFe3 rjbw== X-Gm-Message-State: APjAAAWuiAYfujRm5MDCRfHbR1j8YI0fEDz6wVn2cOnN/uhvum26T0k7 qHRt9gh4RYFfrlMZx+//+jnDJRH8 X-Google-Smtp-Source: APXvYqwMXrAoCSbLPOoy4VnbaBQVaMQkNGTg0L+4OKZu4H4+NYr6Zce4gSq+2rgV8G2fqR8QO2EEKg== X-Received: by 2002:a63:8c52:: with SMTP id q18mr9109451pgn.284.1570103727404; Thu, 03 Oct 2019 04:55:27 -0700 (PDT) Received: from [192.168.1.105] (180-150-68-130.b49644.syd.nbn.aussiebb.net. [180.150.68.130]) by smtp.gmail.com with ESMTPSA id h68sm3118223pfb.149.2019.10.03.04.55.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Oct 2019 04:55:26 -0700 (PDT) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: svn commit: r352953 - in head/usr.bin: killall split To: Kyle Evans , Conrad Meyer Cc: Alexander Kabaev , src-committers , svn-src-all , svn-src-head References: <201910020615.x926FUJj091147@repo.freebsd.org> From: Kubilay Kocak Message-ID: <0faf5475-b409-5d4c-da0a-4ec9b9c66e1d@FreeBSD.org> Date: Thu, 3 Oct 2019 21:55:20 +1000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Thunderbird/70.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46kWfT17zSz419p X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=C9HqeUi/; dmarc=none; spf=pass (mx1.freebsd.org: domain of koobsfreebsd@gmail.com designates 2607:f8b0:4864:20::441 as permitted sender) smtp.mailfrom=koobsfreebsd@gmail.com X-Spamd-Result: default: False [-3.26 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[koobs@FreeBSD.org]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; FORGED_SENDER(0.30)[koobs@FreeBSD.org,koobsfreebsd@gmail.com]; IP_SCORE(-1.06)[ip: (-0.51), ipnet: 2607:f8b0::/32(-2.57), asn: 15169(-2.16), country: US(-0.05)]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_NEQ_ENVFROM(0.00)[koobs@FreeBSD.org,koobsfreebsd@gmail.com]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_IN_DNSWL_NONE(0.00)[1.4.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Oct 2019 11:55:29 -0000 On 2/10/2019 9:59 pm, Kyle Evans wrote: > Sorry for the crap formatting, mobile. > > We can perhaps also fix this class with a proper modelling file. koobs was > going to send out an email about it, but I haven't seen anything. Thanks for the public reminder Kyle :] I'll flick it out soon > On Wed, Oct 2, 2019, 02:03 Conrad Meyer wrote: > >> Hi Alexander, >> >> Coverity has millions of spurious warnings of this class and they're >> basically all false positives. I think we should instead try to >> figure out how to disable this class of warning on our codebase, since >> it is largely incorrect. >> >> I would encourage reverting this change, because it uglies up the code >> for no functional benefit. The code was correct before the change; >> only Coverity was wrong. >> >> Best, >> Conrad >> >> On Tue, Oct 1, 2019 at 11:15 PM Alexander Kabaev wrote: >>> >>> Author: kan >>> Date: Wed Oct 2 06:15:30 2019 >>> New Revision: 352953 >>> URL: https://svnweb.freebsd.org/changeset/base/352953 >>> >>> Log: >>> Convert pnmatch to single element array in regexec calls >>> >>> The regexec function is declared as taking an array of regmatch_t >>> elements, and passing in the pointer to singleton element, while >>> correct, triggers a Coverity warning. Convert the singleton into >>> an array of one to silence the warning. >>> >>> Reported by: Coverity >>> Coverity CID: 1009732, 1009733 >>> MFC after: 2 weeks >>> >>> Modified: >>> head/usr.bin/killall/killall.c >>> head/usr.bin/split/split.c >>> >>> Modified: head/usr.bin/killall/killall.c >>> >> ============================================================================== >>> --- head/usr.bin/killall/killall.c Wed Oct 2 02:37:34 2019 >> (r352952) >>> +++ head/usr.bin/killall/killall.c Wed Oct 2 06:15:30 2019 >> (r352953) >>> @@ -98,7 +98,7 @@ main(int ac, char **av) >>> struct stat sb; >>> struct passwd *pw; >>> regex_t rgx; >>> - regmatch_t pmatch; >>> + regmatch_t pmatch[1]; >>> int i, j, ch; >>> char buf[256]; >>> char first; >>> @@ -361,9 +361,9 @@ main(int ac, char **av) >>> } >>> } >>> if (mflag) { >>> - pmatch.rm_so = 0; >>> - pmatch.rm_eo = strlen(thiscmd); >>> - if (regexec(&rgx, thiscmd, 0, &pmatch, >>> + pmatch[0].rm_so = 0; >>> + pmatch[0].rm_eo = strlen(thiscmd); >>> + if (regexec(&rgx, thiscmd, 0, pmatch, >>> REG_STARTEND) != 0) >>> matched = 0; >>> regfree(&rgx); >>> @@ -387,9 +387,9 @@ main(int ac, char **av) >>> } >>> } >>> if (mflag) { >>> - pmatch.rm_so = 0; >>> - pmatch.rm_eo = strlen(thiscmd); >>> - if (regexec(&rgx, thiscmd, 0, &pmatch, >>> + pmatch[0].rm_so = 0; >>> + pmatch[0].rm_eo = strlen(thiscmd); >>> + if (regexec(&rgx, thiscmd, 0, pmatch, >>> REG_STARTEND) == 0) >>> matched = 1; >>> regfree(&rgx); >>> >>> Modified: head/usr.bin/split/split.c >>> >> ============================================================================== >>> --- head/usr.bin/split/split.c Wed Oct 2 02:37:34 2019 (r352952) >>> +++ head/usr.bin/split/split.c Wed Oct 2 06:15:30 2019 (r352953) >>> @@ -281,11 +281,11 @@ split2(void) >>> >>> /* Check if we need to start a new file */ >>> if (pflag) { >>> - regmatch_t pmatch; >>> + regmatch_t pmatch[1]; >>> >>> - pmatch.rm_so = 0; >>> - pmatch.rm_eo = len - 1; >>> - if (regexec(&rgx, bfr, 0, &pmatch, REG_STARTEND) >> == 0) >>> + pmatch[0].rm_so = 0; >>> + pmatch[0].rm_eo = len - 1; >>> + if (regexec(&rgx, bfr, 0, pmatch, REG_STARTEND) >> == 0) >>> newfile(); >>> } else if (lcnt++ == numlines) { >>> newfile(); >> >