summary refs log tree commit diff
path: root/sunrpc/svc_udp.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2006-05-05 16:18:45 +0000
committerUlrich Drepper <drepper@redhat.com>2006-05-05 16:18:45 +0000
commitcdb9c32138fe80cc4767b5c597713cf773e12f0e (patch)
treee57fee5bcb50042464adb7d4331e46359d04e96f /sunrpc/svc_udp.c
parentfff04b32afcf55edd678f7635a70f8918c4a0bd9 (diff)
downloadglibc-cdb9c32138fe80cc4767b5c597713cf773e12f0e.tar.gz
glibc-cdb9c32138fe80cc4767b5c597713cf773e12f0e.tar.xz
glibc-cdb9c32138fe80cc4767b5c597713cf773e12f0e.zip
* sunrpc/svcauth_des.c (cache_init): Use calloc instead of
	malloc&bzero.

	* sunrpc/svc_udp.c (BZERO): Remove definition.
	(CALLOC): Define.
	(svc_enablecache): Use CALLOC instead of ALLOC&BZERO.

	* sunrpc/des_impl.c: Remove ALT_ECB support.  We never used it.
	(des_SPtrans): Use uint32_t type.
	(des_skb): Likewise.

	* sunrpc/xdr_ref.c (xdr_reference): Use calloc instead of malloc&bzero.

	place where the iso639 array might be accessed beyond the limits.
Diffstat (limited to 'sunrpc/svc_udp.c')
-rw-r--r--sunrpc/svc_udp.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sunrpc/svc_udp.c b/sunrpc/svc_udp.c
index 67b84f184f..dfeb6de70f 100644
--- a/sunrpc/svc_udp.c
+++ b/sunrpc/svc_udp.c
@@ -406,8 +406,8 @@ svcudp_destroy (xprt)
 #define ALLOC(type, size)	\
 	(type *) mem_alloc((unsigned) (sizeof(type) * (size)))
 
-#define BZERO(addr, type, size)	 \
-	__bzero((char *) addr, sizeof(type) * (int) (size))
+#define CALLOC(type, size)	\
+  (type *) calloc (sizeof (type), size)
 
 /*
  * An entry in the cache
@@ -482,15 +482,14 @@ svcudp_enablecache (SVCXPRT *transp, u_long size)
     }
   uc->uc_size = size;
   uc->uc_nextvictim = 0;
-  uc->uc_entries = ALLOC (cache_ptr, size * SPARSENESS);
+  uc->uc_entries = CALLOC (cache_ptr, size * SPARSENESS);
   if (uc->uc_entries == NULL)
     {
       mem_free (uc, sizeof (struct udp_cache));
       CACHE_PERROR (_("enablecache: could not allocate cache data"));
       return 0;
     }
-  BZERO (uc->uc_entries, cache_ptr, size * SPARSENESS);
-  uc->uc_fifo = ALLOC (cache_ptr, size);
+  uc->uc_fifo = CALLOC (cache_ptr, size);
   if (uc->uc_fifo == NULL)
     {
       mem_free (uc->uc_entries, size * SPARSENESS);
@@ -498,7 +497,6 @@ svcudp_enablecache (SVCXPRT *transp, u_long size)
       CACHE_PERROR (_("enablecache: could not allocate cache fifo"));
       return 0;
     }
-  BZERO (uc->uc_fifo, cache_ptr, size);
   su->su_cache = (char *) uc;
   return 1;
 }