Mercurial > illumos > illumos-gate
changeset 14061:ea145778fff5
3843 kstat should handle NULL string values
Reviewed by: Carlos Cardenas <carlos.cardenas@joyent.com>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Approved by: Dan McDonald <danmcd@nexenta.com>
author | Theo Schlossnagle <jesus@omniti.com> |
---|---|
date | Sun, 23 Jun 2013 18:40:00 +0000 |
parents | aeb4e8fef072 |
children | 91abf1cc1546 |
files | usr/src/cmd/stat/kstat/kstat.h |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/cmd/stat/kstat/kstat.h Thu Jun 20 14:43:17 2013 -0800 +++ b/usr/src/cmd/stat/kstat/kstat.h Sun Jun 23 18:40:00 2013 +0000 @@ -143,7 +143,7 @@ { \ ks_value_t v; \ v.str.addr.ptr = safe_strdup(V); \ - v.str.len = strlen(V); \ + v.str.len = (V) ? strlen(V) : 0; \ nvpair_insert(I, N, &v, KSTAT_DATA_STRING); \ }