Subject: Re: NULL program argument checks?
To: None <tech-security@netbsd.org>
From: Christos Zoulas <christos@astron.com>
List: tech-security
Date: 04/06/2006 01:02:09
In article <1hdcg82.17s60i31bwtebhM%manu@netbsd.org>,
Emmanuel Dreyfus <manu@netbsd.org> wrote:
>Hi
>
>I'm working on bugs found by Coverity, and I have this one:
>
>int main (ac, av) 
>...
>        if (ac < 2)
>                fatal error...
>
>        id = av[1];
>
>        len = strlen(id);
>
>It complain because I have not checked id != NULL. Is it safe to assume
>that if ac >= n, then av[n + 1] is not NULL? On NetBSD? Generally
>speaking?

This will only happen if id is checked somewhere else for NULL or av is
tested somewhere else for NULL. What's the CID?

christos