apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <trawi...@bellsouth.net>
Subject Re: cvs commit: apr-util/include apr_md4.h
Date Mon, 04 Jun 2001 18:25:18 GMT
jerenkrantz@apache.org writes:

> jerenkrantz    01/06/04 10:21:56
> 
>   Modified:    crypto   apr_md4.c
>                include  apr_md4.h
>   Log:
>   Update error handling and add apr_md4 function.
>   Submitted by:	Sander Striker <striker@samba-tng.org>
>   Reviewed by:	Justin Erenkrantz
>   
>   Index: apr_md4.c
>   ===================================================================
>   RCS file: /home/cvs/apr-util/crypto/apr_md4.c,v
>   retrieving revision 1.1
>   retrieving revision 1.2
>   diff -u -r1.1 -r1.2
>   --- apr_md4.c	2001/06/01 22:34:06	1.1
>   +++ apr_md4.c	2001/06/04 17:21:51	1.2
>   @@ -150,6 +150,9 @@
>     */
>    APU_DECLARE(apr_status_t) apr_md4_init(apr_md4_ctx_t *context)
>    {
>   +    if (!context)
>   +        return APR_EINVAL;
>   +    

Justin, I'm sorry I didn't see this before.

yuck!

If the coder can't manage to pass non-NULL then they probably aren't
going to check the return code either...  They also didn't do much
testing :)  Either way I don't care.

We're doing a disservice to the user of such an application because
the program will tend to silently fail instead of stopping dead in its
tracks with a suitable corefile for debugging...

We don't actually help anybody with such code, we make it worse in
case such code actually makes it into production, we clutter the code,
and we make it slower for all production uses.

-1

>   +    if (!context)
>   +        return APR_EINVAL;

ditto

>   @@ -203,6 +209,9 @@
>        apr_size_t inbytes_left, outbytes_left;
>    #endif
>    
>   +    if (!context)
>   +        return APR_EINVAL;

ditto

>   @@ -283,6 +292,9 @@
>        unsigned char bits[8];
>        unsigned int idx, padLen;
>    
>   +    if (!context)
>   +        return APR_EINVAL;

ditto

-- 
Jeff Trawick | trawickj@bellsouth.net | PGP public key at web site:
       http://www.geocities.com/SiliconValley/Park/9289/
             Born in Roswell... married an alien...


Mime
View raw message