From a93fe0ed4d1369550a399d6d84c94ea05645e494 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Thu, 17 Mar 2005 13:25:35 +0000 Subject: [PATCH] (hex_encode): wrap SIZE_T_MAX git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14655 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/roken/hex.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/roken/hex.c b/lib/roken/hex.c index 41f77a2eb..29ed0a082 100644 --- a/lib/roken/hex.c +++ b/lib/roken/hex.c @@ -60,8 +60,10 @@ hex_encode(const void *data, size_t size, char **str) size_t i; char *p; +#ifdef SIZE_T_MAX if (size + 1 > SIZE_T_MAX/2) return -1; +#endif p = malloc(size * 2 + 1); if (p == NULL)