From 168b1a758bcc50e916d12c83c2e69e0890a9fe4c Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Mon, 9 Mar 2015 20:43:14 +0000 Subject: [PATCH] =?UTF-8?q?5589=20improper=20use=20of=20NULL=20in=20tools/?= =?UTF-8?q?ctf=20Reviewed=20by:=20David=20H=C3=B6ppner=20<0xffea@gmail.com?= =?UTF-8?q?>=20Reviewed=20by:=20Josef=20"Jeff"=20Sipek=20=20Approved=20by:=20Dan=20McDonald=20?= =?UTF-8?q?=20Author:=20Richard=20PALO=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit illumos/illumos-gate@ad0b1ea5d69a45fe23c434277599e315f29a5fca --- tools/ctf/cvt/ctf.c | 2 +- tools/ctf/cvt/dwarf.c | 2 +- tools/ctf/cvt/output.c | 8 +++----- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/tools/ctf/cvt/ctf.c b/tools/ctf/cvt/ctf.c index 1e425758c249..83f09cb43e6e 100644 --- a/tools/ctf/cvt/ctf.c +++ b/tools/ctf/cvt/ctf.c @@ -1216,7 +1216,7 @@ decompress_ctf(caddr_t cbuf, size_t cbufsz, caddr_t dbuf, size_t dbufsz) (rc = inflate(&zstr, Z_NO_FLUSH)) != Z_STREAM_END || (rc = inflateEnd(&zstr)) != Z_OK) { warning("CTF decompress zlib error %s\n", zError(rc)); - return (NULL); + return (0); } debug(3, "reflated %lu bytes to %lu, pointer at %d\n", diff --git a/tools/ctf/cvt/dwarf.c b/tools/ctf/cvt/dwarf.c index e261818d3a66..5fdcd35e33da 100644 --- a/tools/ctf/cvt/dwarf.c +++ b/tools/ctf/cvt/dwarf.c @@ -1714,7 +1714,7 @@ static const die_creator_t die_creators[] = { { DW_TAG_variable, DW_F_NOTDP, die_variable_create }, { DW_TAG_volatile_type, 0, die_volatile_create }, { DW_TAG_restrict_type, 0, die_restrict_create }, - { 0, NULL } + { 0, 0, NULL } }; static const die_creator_t * diff --git a/tools/ctf/cvt/output.c b/tools/ctf/cvt/output.c index f699fbf6d30f..90c87dabf331 100644 --- a/tools/ctf/cvt/output.c +++ b/tools/ctf/cvt/output.c @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Routines for preparing tdata trees for conversion into CTF data, and * for placing the resulting data into an output file. @@ -466,7 +464,7 @@ write_file(Elf *src, const char *srcname, Elf *dst, const char *dstname, int pad; int i; - if (gelf_newehdr(dst, gelf_getclass(src)) == NULL) + if (gelf_newehdr(dst, gelf_getclass(src)) == 0) elfterminate(dstname, "Cannot copy ehdr to temp file"); gelf_getehdr(src, &sehdr); memcpy(&dehdr, &sehdr, sizeof (GElf_Ehdr)); @@ -482,7 +480,7 @@ write_file(Elf *src, const char *srcname, Elf *dst, const char *dstname, */ if (sehdr.e_phnum != 0) { (void) elf_flagelf(dst, ELF_C_SET, ELF_F_LAYOUT); - if (gelf_newphdr(dst, sehdr.e_phnum) == NULL) + if (gelf_newphdr(dst, sehdr.e_phnum) == 0) elfterminate(dstname, "Cannot make phdrs in temp file"); for (i = 0; i < sehdr.e_phnum; i++) { @@ -616,7 +614,7 @@ write_file(Elf *src, const char *srcname, Elf *dst, const char *dstname, } } - if (gelf_update_shdr(dscn, &shdr) == NULL) + if (gelf_update_shdr(dscn, &shdr) == 0) elfterminate(dstname, "Cannot update sect %s", sname); new_offset = (off_t)shdr.sh_offset;