From owner-freebsd-current@FreeBSD.ORG Tue Jan 18 20:58:19 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9BD21065673 for ; Tue, 18 Jan 2011 20:58:19 +0000 (UTC) (envelope-from tijl@coosemans.org) Received: from mailrelay012.isp.belgacom.be (mailrelay012.isp.belgacom.be [195.238.6.179]) by mx1.freebsd.org (Postfix) with ESMTP id 4EAEC8FC1C for ; Tue, 18 Jan 2011 20:58:18 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuMFAD+MNU1bsV97/2dsb2JhbACWQY4ZdMJRhVAE Received: from 123.95-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.95.123]) by relay.skynet.be with ESMTP; 18 Jan 2011 21:58:17 +0100 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.4/8.14.4) with ESMTP id p0IKwGba006198; Tue, 18 Jan 2011 21:58:17 +0100 (CET) (envelope-from tijl@coosemans.org) From: Tijl Coosemans To: freebsd-current@freebsd.org Date: Tue, 18 Jan 2011 21:58:07 +0100 User-Agent: KMail/1.13.5 (FreeBSD/9.0-CURRENT; KDE/4.5.2; i386; ; ) References: <20110105131439.GN23329@acme.spoerlein.net> In-Reply-To: <20110105131439.GN23329@acme.spoerlein.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart9189369.4dPBRS3gXQ"; protocol="application/pgp-signature"; micalg=pgp-sha256 Content-Transfer-Encoding: 7bit Message-Id: <201101182158.14438.tijl@coosemans.org> Cc: Ulrich =?iso-8859-1?q?Sp=F6rlein?= Subject: Re: FYI: clang static analyzer page has moved to http://scan.freebsd.your.org/freebsd-head/ X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 20:58:19 -0000 --nextPart9189369.4dPBRS3gXQ Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable On Wednesday 05 January 2011 14:14:39 Ulrich Sp=F6rlein wrote: > Now that I'm fairly confident that the stability issues with your.org's > VMs have been resolved, I'd like to point you to the new and improved, > semi-weekly analyzer runs at >=20 > http://scan.freebsd.your.org/freebsd-head/ I came across an interesting false positive here: http://scan.freebsd.your.org/freebsd-head/sbin.geom.class/2011-01-15-amd64/= report-1aAmgE.html#EndPath | assert((strcmp(type, "keyfile") =3D=3D 0 && ctxp !=3D NULL && | passbuf =3D=3D NULL && passbufsize =3D=3D 0) || | (strcmp(type, "passfile") =3D=3D 0 && ctxp =3D=3D NULL && | passbuf !=3D NULL && passbufsize > 0)); | assert(strcmp(type, "keyfile") =3D=3D 0 || passbuf[0] =3D=3D '\0'); |=20 | Within the expansion of the macro 'assert': | Array access (from variable 'passbuf') results in a null pointer | dereference. I think the problem here is that the analyser allows strcmp(type, "keyfile") to return zero in the first assertion and nonzero in the second. This cannot happen of course and the analyser should know that because strcmp has been declared __pure__ in string.h. A workaround in this case would be to merge the two assertions. --nextPart9189369.4dPBRS3gXQ Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iF4EABEIAAYFAk01/uYACgkQfoCS2CCgtiuvnAD9HbPuaXnmh16KSckJRAeG+/C/ Mp8MwFGz1okKYlpEmGoA/2TJiTkssuurcap3/2fEra39L6IDMaYBL0xinJ+kmJSB =zv60 -----END PGP SIGNATURE----- --nextPart9189369.4dPBRS3gXQ--