apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject Re: cvs commit: apr/user/netware userinfo.c groupinfo.c
Date Fri, 31 Aug 2001 18:38:14 GMT
From: "Cliff Woolley" <cliffwoolley@yahoo.com>
Sent: Friday, August 31, 2001 12:36 PM

On 31 Aug 2001 bnicholes@apache.org wrote:

> bnicholes    01/08/31 09:28:06
>   Added:       user/netware userinfo.c groupinfo.c
>   Log:
>   NetWare user and group info functions
>   Revision  Changes    Path
>   1.1                  apr/user/netware/userinfo.c
>   APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname,
>                                                    const char *username,
>                                                    apr_pool_t *p)
>   {
>       return APR_SUCCESS;
>   }

 >Stubs like this in APR typically return APR_ENOTIMPL so that the caller
>has some way to know that *dirname (in this example) was not set so it can
>avoid a segfault if it wants...


More than typically.  You've promised that apr_get_home_directory has set
dirname.  If the variable that dirname points at 'happened' to have some valid
pointer (to garbage data) - you might not even segfault.  This is a bug.

As Cliff points out, APR_ENOTIMPL is a safer stub if there is anything the
function was required to return/alter as part of its behavior.

View raw message