]> arthur.barton.de Git - netatalk.git/commitdiff
Fix a potential divide by zero problem.
authorjmarcus <jmarcus>
Wed, 28 Nov 2001 03:10:01 +0000 (03:10 +0000)
committerjmarcus <jmarcus>
Wed, 28 Nov 2001 03:10:01 +0000 (03:10 +0000)
etc/afpd/ofork.c

index 82c6c9f4e63e7516b6f15dce23614e766336c9af..97110bc71d3a5470178800114ff89fe55826cabd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ofork.c,v 1.5 2001-08-15 01:37:34 srittau Exp $
+ * $Id: ofork.c,v 1.6 2001-11-28 03:10:01 jmarcus Exp $
  *
  * Copyright (c) 1996 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -229,9 +229,9 @@ of_alloc(vol, dir, path, ofrefnum, eid, ad)
 
 struct ofork *of_find(const u_int16_t ofrefnum )
 {
-   if (!oforks)
+   if (!oforks || !nforks)
      return NULL;
-
+       
     return( oforks[ ofrefnum % nforks ] );
 }