[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: inconsistent null-ptr handling in utf-path related functions

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Tue, 26 Jan 2016 22:57:15 +0000

Stefan Fuhrmann wrote on Tue, Jan 26, 2016 at 09:21:44 +0100:
> From that, I would derive the following heuristics:
>

Once we agree upon a set of guidelines, it'll be nice to add it to
HACKING, at least as a link to your email.

They heuristics you propose sound good to me, so +0. (The only reason
I'm not +1 is that I haven't reviewed them carefully enough yet.)

Cheers,

Daniel

> * Path and string validation functions shall not crash upon NULL
> inputs; error messages for NULL strings should explicitly show
> "NULL" as the problem.
>
> * Outside path, error and basic string processing, NULL pointers
> are invalid for mandatory parameters. Optional parameters are
> to be clearly documented as such (e.g. cancellation callbacks).
>
> * To make high-level functions e.g. within libclient robust against
> NULL pointers, use assertions. Don't try to mask those conditions
> and "limp on".
>
> Applied to svn_fs__path_valid and friends, they should be fixed
> to exhibit defined behaviour when called with NULL inputs.
>
> -- Stefan^2.
Received on 2016-01-26 23:57:22 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.