diff options
author | Hans Rosenfeld <hans.rosenfeld@joyent.com> | 2019-12-13 17:17:52 +0100 |
---|---|---|
committer | Hans Rosenfeld <hans.rosenfeld@joyent.com> | 2020-03-25 17:04:43 +0100 |
commit | 7adb68a6af9135eabca6203d488597cb40c4675c (patch) | |
tree | eacee3e37cfca30d81483b2ef80977434b7dd5f4 | |
parent | eb00b1c8a31c2253a353644606388dff5b0e0275 (diff) | |
download | illumos-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.c | 25 |
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, |