on failure set hex_encode output to NULL

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24122 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2008-12-11 05:03:27 +00:00
parent c9122e8b28
commit cc0575ed41

View File

@@ -60,8 +60,10 @@ hex_encode(const void *data, size_t size, char **str)
char *p; char *p;
/* check for overflow */ /* check for overflow */
if (size * 2 < size) if (size * 2 < size) {
*str = NULL;
return -1; return -1;
}
p = malloc(size * 2 + 1); p = malloc(size * 2 + 1);
if (p == NULL) { if (p == NULL) {