summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Rosenfeld <hans.rosenfeld@joyent.com>2019-12-13 17:17:52 +0100
committerHans Rosenfeld <hans.rosenfeld@joyent.com>2020-03-25 17:04:43 +0100
commit7adb68a6af9135eabca6203d488597cb40c4675c (patch)
treeeacee3e37cfca30d81483b2ef80977434b7dd5f4
parenteb00b1c8a31c2253a353644606388dff5b0e0275 (diff)
downloadillumos-joyent-7adb68a6af9135eabca6203d488597cb40c4675c.tar.gz
12196 fmadm faulty NULL pointer dereference
Reviewed by: Toomas Soome <tsoome@me.com> Reviewed by: Andrew Stormont <andyjstormont@gmail.com> Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r--usr/src/cmd/fm/fmadm/common/faulty.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/usr/src/cmd/fm/fmadm/common/faulty.c b/usr/src/cmd/fm/fmadm/common/faulty.c
index 21d4143532..ef3d5671dc 100644
--- a/usr/src/cmd/fm/fmadm/common/faulty.c
+++ b/usr/src/cmd/fm/fmadm/common/faulty.c
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2020 Joyent, Inc.
*/
#include <sys/types.h>
@@ -1214,17 +1215,19 @@ print_sup_record(status_record_t *srp, int opt_i, int full)
n++;
}
(void) printf("\n");
- (void) printf("%s %s", dgettext("FMD", "Host :"),
- srp->host->server);
- if (srp->host->domain)
- (void) printf("\t%s %s", dgettext("FMD", "Domain :"),
- srp->host->domain);
- (void) printf("\n%s %s", dgettext("FMD", "Platform :"),
- srp->host->platform);
- (void) printf("\t%s %s", dgettext("FMD", "Chassis_id :"),
- srp->host->chassis ? srp->host->chassis : "");
- (void) printf("\n%s %s\n\n", dgettext("FMD", "Product_sn :"),
- srp->host->product_sn? srp->host->product_sn : "");
+ if (srp->host) {
+ (void) printf("%s %s", dgettext("FMD", "Host :"),
+ srp->host->server);
+ if (srp->host->domain)
+ (void) printf("\t%s %s", dgettext("FMD",
+ "Domain :"), srp->host->domain);
+ (void) printf("\n%s %s", dgettext("FMD", "Platform :"),
+ srp->host->platform);
+ (void) printf("\t%s %s", dgettext("FMD", "Chassis_id :"),
+ srp->host->chassis ? srp->host->chassis : "");
+ (void) printf("\n%s %s\n\n", dgettext("FMD", "Product_sn :"),
+ srp->host->product_sn ? srp->host->product_sn : "");
+ }
if (srp->class)
print_name_list(srp->class,
dgettext("FMD", "Fault class :"), 0, srp->class->pct,