Bug #8481
nvmeadm: nvme_dskname() string handling is buggy
Start date:
2017-07-10
Due date:
% Done:
100%
Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage
Gerrit CR:
Description
There are two issues in nvme_dskname(). First, it is assumed that the output of di_dim_path_dev() either returns NULL or a string that is at least 2 chars long. And second, there is an ineffective NULL pointer check following strrchr(path, '/') + 1.
Updated by Hans Rosenfeld over 3 years ago
Webrev: https://grumpf.hope-2000.org/illumos-8481/
Testing: I verified that the disk names are still resolved correctly by nvmeadm, but I didn't exercise the error handling for when di_dim_path_dev() does something completely unexpected.
This change has been in illumos-joyent since July.
Updated by Electric Monk over 3 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
git commit e7e9ed12e28c345b730aae97b62991a1b640fc7c
commit e7e9ed12e28c345b730aae97b62991a1b640fc7c Author: Hans Rosenfeld <hans.rosenfeld@joyent.com> Date: 2017-09-12T14:59:24.000Z 8481 nvmeadm: nvme_dskname() string handling is buggy Reviewed by: Patrick Mooney <patrick.mooney@joyent.com> Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com> Reviewed by: Yuri Pankov <yuripv@gmx.com> Reviewed by: Toomas Soome <tsoome@me.com> Approved by: Dan McDonald <danmcd@joyent.com>