From cdb9c32138fe80cc4767b5c597713cf773e12f0e Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 5 May 2006 16:18:45 +0000 Subject: * 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. --- sunrpc/svc_udp.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'sunrpc/svc_udp.c') 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; } -- cgit v1.2.1