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

Alasdair G Kergon agk at redhat.com
Tue Oct 26 14:02:37 UTC 2010


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




More information about the lvm-devel mailing list