summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libc/rpc/svc_udp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/rpc/svc_udp.c b/lib/libc/rpc/svc_udp.c
index 6e5c77d7f2c..361a107bbf2 100644
--- a/lib/libc/rpc/svc_udp.c
+++ b/lib/libc/rpc/svc_udp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: svc_udp.c,v 1.17 2009/06/06 03:28:34 deraadt Exp $ */
+/* $OpenBSD: svc_udp.c,v 1.18 2009/06/07 01:21:00 millert Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
* unrestricted use provided that this legend is included on all tape
@@ -347,7 +347,7 @@ svcudp_enablecache(SVCXPRT *transp, u_long size)
}
uc->uc_size = size;
uc->uc_nextvictim = 0;
- if (size && sizeof(cache_ptr) * SPARSENESS > SIZE_MAX / size ||
+ if (size > SIZE_MAX / (sizeof(cache_ptr) * SPARSENESS) ||
(uc->uc_entries = calloc(sizeof(cache_ptr) * SPARSENESS, size)) == NULL) {
CACHE_PERROR("enablecache: could not allocate cache data");
free(uc);