From dev-return-2391-apmail-apr-dev-archive=apr.apache.org@apr.apache.org Mon Jun 04 18:28:37 2001 Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 46462 invoked by uid 500); 4 Jun 2001 18:28:29 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 46412 invoked from network); 4 Jun 2001 18:28:25 -0000 X-Authentication-Warning: adsl-77-241-65.rdu.bellsouth.net: trawick set sender to trawickj@bellsouth.net using -f Sender: trawick@bellsouth.net To: dev@apr.apache.org Subject: Re: cvs commit: apr-util/include apr_md4.h References: <20010604172156.40872.qmail@apache.org> From: Jeff Trawick Date: 04 Jun 2001 14:25:18 -0400 In-Reply-To: <20010604172156.40872.qmail@apache.org> Message-ID: Lines: 72 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N 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 > 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...