[PATCH 1/5] Check type is not NULL before access

Alasdair G Kergon <[email protected]>
Newsgroups dev.linux.lists.lvm-devel
Message-ID <[email protected]>
On Tue, Oct 26, 2010 at 02:59:22PM +0200, Zdenek Kabelac wrote:
> Check type before dereference and report internal error in case
> it's undefined and return from the function.
 
> +			if (!type) {
> +				log_error(INTERNAL_ERROR "Type is not defined.");
> +				return;
> +			}

Is this one really an internal library error?

Can it be triggered if someone usees the API incorrectly?

If so, it should be treated like validation.

Alasdair
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.