[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#16589: marked as done (lsearch() is badly broken)



Your message dated Tue, 9 Feb 1999 12:52:25 -0800
with message-id <v0410440eb2e64b2f0a4c@[206.163.71.146]>
and subject line Fixed
has caused the attached bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I'm
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Ian Jackson
(administrator, Debian bugs database)

Received: (at submit) by bugs.debian.org; 4 Jan 1998 04:32:45 +0000
Received: (qmail 2700 invoked from network); 4 Jan 1998 04:32:40 -0000
Received: from chunks.gag.com (bdale@chunks.gag.com@192.133.104.9)
  by 205.229.104.5 with SMTP; 4 Jan 1998 04:32:40 -0000
Received: (from bdale@localhost)
	by chunks.gag.com (8.8.8/8.8.8/Debian/GNU) id VAA15727
	for submit@bugs.debian.org; Sat, 3 Jan 1998 21:43:29 -0700
Date: Sat, 3 Jan 1998 21:43:29 -0700
From: Bdale Garbee <bdale@gag.com>
Message-Id: <199801040443.VAA15727@chunks.gag.com>
To: submit@bugs.debian.org
Subject: lsearch() is badly broken

Package: libc6
Version: 2.0.6-2

The implementation of lsearch() is badly broken.  It should return a pointer
to the matching member of the array, or to the newly added member if no match
is found.  Instead, it's returning a pointer to the matching member of the
array, or null.  Therefore, attempts to add an element *always* return null.

This is the root of about a dozen bug reports against sudo, which is failing
to parse many sudoers config file options due to heavy use of the lsearch()
routine to build arrays of aliases, etc.

The lsearch() routine works correctly in libc5.

My suggestion is that the expression "base + (*nmemb) * size" be computed
before the memcpy call and assigned to 'result', and then 'result' passed
as the first argument to the memcpy call.  Whatever.  Just don't *ever* return
NULL...  :-)

Bdale 


Reply to: