From owner-freebsd-bugs@FreeBSD.ORG Tue May 27 01:34:43 2003 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 57AF237B404 for ; Tue, 27 May 2003 01:34:43 -0700 (PDT) Received: from gandalf.online.bg (gandalf.online.bg [217.75.128.9]) by mx1.FreeBSD.org (Postfix) with SMTP id 6157B43FCB for ; Tue, 27 May 2003 01:34:38 -0700 (PDT) (envelope-from roam@straylight.ringlet.net) Received: (qmail 15918 invoked from network); 27 May 2003 08:28:05 -0000 Received: from office.sbnd.net (HELO straylight.ringlet.net) (217.75.140.130) by gandalf.online.bg with SMTP; 27 May 2003 08:28:04 -0000 Received: (qmail 15425 invoked by uid 1000); 27 May 2003 08:31:39 -0000 Date: Tue, 27 May 2003 11:31:39 +0300 From: Peter Pentchev To: Seva Gluschenko Message-ID: <20030527083139.GA513@straylight.oblivion.bg> Mail-Followup-To: Seva Gluschenko , Dag-Erling Smorgrav , freebsd-bugs@FreeBSD.org References: <200305262053.h4QKr3GB026031@freefall.freebsd.org> <20030527121942.W33922@road.demos.su> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="k+w/mQv8wyuph6w0" Content-Disposition: inline In-Reply-To: <20030527121942.W33922@road.demos.su> User-Agent: Mutt/1.5.4i cc: freebsd-bugs@FreeBSD.org cc: Dag-Erling Smorgrav Subject: Re: bin/52691: str[n][case]cmp may cause segmentation violationwith NULL pointers passed X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2003 08:34:43 -0000 --k+w/mQv8wyuph6w0 Content-Type: text/plain; charset=windows-1251 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 27, 2003 at 12:20:37PM +0400, Seva Gluschenko wrote: > Message of Dag-Erling Smorgrav at May 26 13:53 ... >=20 > DS> Synopsis: str[n][case]cmp may cause segmentation violation with NULL = pointers passed > DS> > DS> State-Changed-From-To: open->closed > DS> State-Changed-By: des > DS> State-Changed-When: Mon May 26 13:53:02 PDT 2003 > DS> State-Changed-Why: > DS> The bug is in the application that passes NULL to strcmp. >=20 > Well, sir, can you please quote me some ISO C89 or another standard > which allows str*cmp not to care about NULL pointers? I think that in this case, the burden just might be on the programmer; with all due respect, could you quote any part of the standard that specifies that str[n]cmp behaves in a special way about NULL pointers? In my experience, such behavior is usually explicitly documented, such as the EBADF or EINVAL error returns from select(2), under an 'ERRORS' or similar section of the standard. The SUSv3 description of strncmp(3), available online for a free registration at http://www.unix-systems.org/single_unix_specification/, does not seem to mention NULL pointers or error conditions anywhere, except for the 'no errors are defined' sentence in the 'ERRORS' section. G'luck, Peter --=20 Peter Pentchev roam@ringlet.net roam@sbnd.net roam@FreeBSD.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 Hey, out there - is it *you* reading me, or is it someone else? --k+w/mQv8wyuph6w0 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQE+0yJq7Ri2jRYZRVMRAhBqAKCHbmgf8JHDIj39JwVahjfnvaKlAwCdEMFo y5CTpFSqWZNPOsIpisLoAK0= =Qnay -----END PGP SIGNATURE----- --k+w/mQv8wyuph6w0--