(hex_encode): wrap SIZE_T_MAX

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14655 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2005-03-17 13:25:35 +00:00
parent e502ee6379
commit a93fe0ed4d

View File

@@ -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)