diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2001-08-12 08:49:00 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2001-08-12 08:49:00 +0000 |
commit | 603945d8e7e21f759268960f6c5bb4198d1bfeec (patch) | |
tree | 8e9081df26ab028f7421f0f8ee3b22aa2dcc8787 | |
parent | ca77cc963b66a482374ac7cd83dd7aafd15f56f6 (diff) |
fake out malloc(0)
-rw-r--r-- | lib/libz/zutil.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libz/zutil.c b/lib/libz/zutil.c index 7846ce94c2a..32d074e5cb7 100644 --- a/lib/libz/zutil.c +++ b/lib/libz/zutil.c @@ -1,4 +1,4 @@ -/* $OpenBSD: zutil.c,v 1.4 2000/03/02 00:29:52 todd Exp $ */ +/* $OpenBSD: zutil.c,v 1.5 2001/08/12 08:48:59 deraadt Exp $ */ /* zutil.c -- target dependent utility functions for the compression library * Copyright (C) 1995-1998 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h @@ -211,6 +211,8 @@ voidpf zcalloc (opaque, items, size) unsigned size; { if (opaque) items += size - size; /* make compiler happy */ + if (items * size == 0) + return (NULL); return (voidpf)calloc(items, size); } |