delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2002/02/21/07:00:04

Mailing-List: contact cygwin-developers-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT cygwin DOT com>
List-Help: <mailto:cygwin-developers-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-developers-owner AT cygwin DOT com
Delivered-To: mailing list cygwin-developers AT cygwin DOT com
Date: Thu, 21 Feb 2002 12:59:05 +0100 (CET)
From: Joerg Schilling <schilling AT fokus DOT gmd DOT de>
Message-Id: <200202211159.g1LBx5AX001480@burner.fokus.gmd.de>
To: Cygwin-Developers AT cygwin DOT com, cygwin-developers AT cygwin DOT com
Subject: Re: null parameters to functions

>From: Earnie Boyd <earnie_boyd AT yahoo DOT com>

>Christopher Faylor wrote:
>> 
>> On Thu, Feb 21, 2002 at 09:13:56AM +1100, Robert Collins wrote:
>> >Remembering all the effort that went into sanitising various userland
>> >function parameters a few months ago... newlib suffers from similar
>> >flaws (I just noticed one with strcmp (0, foo);).
>> >
>> >Is this something worth fixing?
>> 
>> Agh.  How does linux handle this?  Doe sit return EADDR or something?
>> 

>IIRC, it's not an error in Linux land or most *nixes for that matter. 
>It OS dependent on how addressing a null pointer is handled.  Looking at
>the man page from HPUX 11 it says that null pointer values are treated
>as empty strings.

The standard compliant behavior is to dump core. However not all OS behave
correctly and thus e.g. Software developend on Linux will start dumping core
because the author did not have the possibility to verify his code for
correctness on Linux :-(


Jörg

 EMail:joerg AT schily DOT isdn DOT cs DOT tu-berlin DOT de (home) Jörg Schilling D-13353 Berlin
       js AT cs DOT tu-berlin DOT de		(uni)  If you don't have iso-8859-1
       schilling AT fokus DOT gmd DOT de		(work) chars I am J"org Schilling
 URL:  http://www.fokus.gmd.de/usr/schilling   ftp://ftp.fokus.gmd.de/pub/unix

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019