From e83359656fe4880d77df4da075573820c2a7adc0 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Mon, 11 Feb 2019 22:45:35 +0200 Subject: 10393 ctf: NULL pointer errors Reviewed by: Andy Stormont Reviewed by: Robert Mustacchi Reviewed by: Andy Fiddaman Approved by: Dan McDonald --- usr/src/lib/libctf/common/ctf_elfwrite.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'usr/src/lib/libctf/common/ctf_elfwrite.c') diff --git a/usr/src/lib/libctf/common/ctf_elfwrite.c b/usr/src/lib/libctf/common/ctf_elfwrite.c index 7f668fe528..dfefbf6861 100644 --- a/usr/src/lib/libctf/common/ctf_elfwrite.c +++ b/usr/src/lib/libctf/common/ctf_elfwrite.c @@ -68,7 +68,7 @@ ctf_write_elf(ctf_file_t *fp, Elf *src, Elf *dst, int flags) goto out; } - if (gelf_newehdr(dst, gelf_getclass(src)) == NULL) { + if (gelf_newehdr(dst, gelf_getclass(src)) == 0) { ret = ctf_set_errno(fp, ECTF_ELF); goto out; } @@ -108,7 +108,7 @@ ctf_write_elf(ctf_file_t *fp, Elf *src, Elf *dst, int flags) */ if (nphdr != 0) { (void) elf_flagelf(dst, ELF_C_SET, ELF_F_LAYOUT); - if (gelf_newphdr(dst, nphdr) == NULL) { + if (gelf_newphdr(dst, nphdr) == 0) { ret = ctf_set_errno(fp, ECTF_ELF); goto out; } @@ -266,7 +266,7 @@ ctf_write_elf(ctf_file_t *fp, Elf *src, Elf *dst, int flags) } } - if (gelf_update_shdr(dscn, &shdr) == NULL) { + if (gelf_update_shdr(dscn, &shdr) == 0) { ret = ctf_set_errno(fp, ECTF_ELF); goto out; } @@ -351,7 +351,7 @@ ctf_write_elf(ctf_file_t *fp, Elf *src, Elf *dst, int flags) dehdr.e_shstrndx = SHN_XINDEX; else dehdr.e_shstrndx = secxlate[sehdr.e_shstrndx]; - if (gelf_update_ehdr(dst, &dehdr) == NULL) { + if (gelf_update_ehdr(dst, &dehdr) == 0) { ret = ctf_set_errno(fp, ECTF_ELF); goto out; } -- cgit v1.2.3