nvmeadm: nvme_dskname() string handling is buggy
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 about 3 years ago
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 about 3 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
commit e7e9ed12e28c345b730aae97b62991a1b640fc7c Author: Hans Rosenfeld <email@example.com> Date: 2017-09-12T14:59:24.000Z 8481 nvmeadm: nvme_dskname() string handling is buggy Reviewed by: Patrick Mooney <firstname.lastname@example.org> Reviewed by: Jerry Jelinek <email@example.com> Reviewed by: Yuri Pankov <firstname.lastname@example.org> Reviewed by: Toomas Soome <email@example.com> Approved by: Dan McDonald <firstname.lastname@example.org>