Subject: Re: bad diagassert in UTF8 module
To: None <tech-userlevel@netbsd.org>
From: Ignatios Souvatzis <ignatios@cs.uni-bonn.de>
List: tech-userlevel
Date: 03/12/2005 00:04:27
On Fri, Mar 11, 2005 at 10:52:46PM +0100, Joerg Sonnenberger wrote:

> The attached patch removes that assertions, but I'm not 100% sure
> if that is the solution.

> @@ -370,8 +368,6 @@
>  _citrus_UTF8_encoding_module_init(_UTF8EncodingInfo * __restrict ei,
>  				  const void * __restrict var, size_t lenvar)
>  {
> -	_DIAGASSERT(ei != NULL);
> -
>  	_UTF8_init_count();
>  	memset((void *)ei, 0, sizeof(*ei));
>  

I didn't analyze at the others, because the patches don't carry enough
context with them, but this change looks adventurous to me. What would
be the point of not testing for a NULL pointer before memsetting, thus
getting a SEGV instead of whatever assert() uses?

Regards,
	-is