From dev-return-2392-apmail-apr-dev-archive=apr.apache.org@apr.apache.org Mon Jun 04 18:33:53 2001 Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 54529 invoked by uid 500); 4 Jun 2001 18:33:50 -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 54501 invoked from network); 4 Jun 2001 18:33:47 -0000 Date: Mon, 4 Jun 2001 11:36:06 -0700 (PDT) From: X-Sender: To: Jeff Trawick Cc: Subject: Re: cvs commit: apr-util/include apr_md4.h In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N ++1 for all of Jeff's -1's. We have a strict habit of NOT putting in this kind of bogus checking. Ryan On 4 Jun 2001, Jeff Trawick wrote: > 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... > > _______________________________________________________________________________ Ryan Bloom rbb@apache.org 406 29th St. San Francisco, CA 94131 -------------------------------------------------------------------------------