From cc0575ed41e5e4446f48a5fa402c3fb5a23be5b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Thu, 11 Dec 2008 05:03:27 +0000 Subject: [PATCH] on failure set hex_encode output to NULL git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24122 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/roken/hex.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/roken/hex.c b/lib/roken/hex.c index b5ce01e36..68c18a4eb 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) char *p; /* check for overflow */ - if (size * 2 < size) + if (size * 2 < size) { + *str = NULL; return -1; + } p = malloc(size * 2 + 1); if (p == NULL) {