From owner-freebsd-current Wed Aug 7 16:28:11 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D9C8537B400; Wed, 7 Aug 2002 16:28:08 -0700 (PDT) Received: from nagual.pp.ru (pobrecita.freebsd.ru [194.87.13.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id D9D2743E70; Wed, 7 Aug 2002 16:28:07 -0700 (PDT) (envelope-from ache@pobrecita.freebsd.ru) Received: from pobrecita.freebsd.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.12.5/8.12.5) with ESMTP id g77NRwmW001212; Thu, 8 Aug 2002 03:28:04 +0400 (MSD) (envelope-from ache@pobrecita.freebsd.ru) Received: (from ache@localhost) by pobrecita.freebsd.ru (8.12.5/8.12.5/Submit) id g77NRtdQ001210; Thu, 8 Aug 2002 03:27:56 +0400 (MSD) (envelope-from ache) Date: Thu, 8 Aug 2002 03:27:52 +0400 From: "Andrey A. Chernov" To: phk@freebsd.org, current@freebsd.org Subject: phk malloc() sometimes forget to set errno Message-ID: <20020807232750.GA1168@nagual.pp.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.1i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I found at least one case: -------------------------------------------- imalloc(...) ... if ((size + malloc_pagesize) < size) /* Check for overflow */ result = 0; ... return result; -------------------------------------------- I.e. NULL returned, but errno is not set and can be even 0 Please fix this bug. According to POSIX, ENOMEM is required at least, but EINVAL here is more applicable (as POSIX extension). -- Andrey A. Chernov http://ache.pp.ru/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message