Kyle Hamilton wrote:
...
agree, the current code is not really consistent here. If we assume
that EC_GROUP::meth cannot be NULL in a valid EC_GROUP object the
check for "group->meth != NULL" is superfluous and misleading and
should be removed. Done.


The check for group->meth != NULL should be above any of the other
code in the function.  (Just because 'group' != NULL doesn't mean that
group->meth != NULL.)

as I said the EC_GROUP::meth field cannot be NULL in a valid
EC_GROUP object. If EC_GROUP::meth is NULL the memory has been
corrupted but in this case a check for meth != NULL isn't really
reliable anymore (note: EC_GROUP::meth is a pointer to something
like a virtual function table which is set when the object is
created and cannot be changed afterwards).

...
note: as the user supplied arrary of BIGNUM pointers is not
delimited by a NULL pointer a check for scalars[i] != NULL
isn't very useful


Even if the user supplies a NULL pointer for a BIGNUM it should return
an error, not SEGV.

perhaps, on the other hand is the calling function in a better
position to decide whether or not the pointer points to valid
object (pointer != NULL doesn't imply that it points to a valid
object) so a check for pointer != NULL is at best an additional
check for something that should have been checked in the calling
function ...
I'm not against checks for parameters == NULL, however I think
if we do that it should be done in all functions ...

Cheers,
Nils
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to