Subject: Re: kern/35278: veriexec sometimes feeds user va to log(9)
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Elad Efrat <elad@NetBSD.org>
List: netbsd-bugs
Date: 12/23/2006 10:15:04
The following reply was made to PR kern/35278; it has been noted by GNATS.
From: Elad Efrat <elad@NetBSD.org>
To: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Cc: gnats-bugs@NetBSD.org
Subject: Re: kern/35278: veriexec sometimes feeds user va to log(9)
Date: Sat, 23 Dec 2006 12:09:19 +0200
YAMAMOTO Takashi wrote:
> i don't like "returning NULL means EFAULT".
> it can fail due to other reasons. it's better to return errno.
okay. I guess I can add a parameter.
>> +const char *
>> +pathname_path(pathname_t path)
>> +{
>> + return (path == NULL ? NULL : path->pathbuf);
>> +}
>
> why do you want to handle path==NULL here?
probably doesn't matter... can be KASSERT.
>> +void
>> +pathname_put(pathname_t path)
>> +{
>> + if ((path != NULL) && (path->pathbuf != NULL) && path->needfree) {
>> + PNBUF_PUT(__UNCONST(path->pathbuf));
>> + free(path, M_TEMP);
>> + }
>> +}
>
> you need to free "path" even when you don't need to free "path->pathbuf".
oops. right.
btw: can't we solve the problem for netbsd-4 with SAVENAME?
-e.