summaryrefslogtreecommitdiff
path: root/usr/src/lib/libctf/common
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2019-02-11 22:45:35 +0200
committerToomas Soome <tsoome@me.com>2019-02-12 17:49:21 +0200
commite83359656fe4880d77df4da075573820c2a7adc0 (patch)
treed6f0a14a061118af99bf1688907ba5fae3b24bb6 /usr/src/lib/libctf/common
parentb83d2fbf46ff51c4409d2bf8ed4c483ef21f456f (diff)
downloadillumos-gate-e83359656fe4880d77df4da075573820c2a7adc0.tar.gz
10393 ctf: NULL pointer errors
Reviewed by: Andy Stormont <astormont@racktopsystems.com> Reviewed by: Robert Mustacchi <rm@joyent.com> Reviewed by: Andy Fiddaman <andy@omniosce.org> Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src/lib/libctf/common')
-rw-r--r--usr/src/lib/libctf/common/ctf_elfwrite.c8
1 files changed, 4 insertions, 4 deletions
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;
}