diff options
author | Karel Zak | 2013-03-27 14:17:52 +0100 |
---|---|---|
committer | Karel Zak | 2013-03-27 14:18:22 +0100 |
commit | 88a6006bc83cc917141d02fd0351d7008e534790 (patch) | |
tree | 8314de97a2e40a5c1efa87bc23b3f71b1ac65d2a /lib | |
parent | lsblk: check returns [coverity scan] (diff) | |
download | kernel-qcow2-util-linux-88a6006bc83cc917141d02fd0351d7008e534790.tar.gz kernel-qcow2-util-linux-88a6006bc83cc917141d02fd0351d7008e534790.tar.xz kernel-qcow2-util-linux-88a6006bc83cc917141d02fd0351d7008e534790.zip |
lsblk: fix hctl buffer usage [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sysfs.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/sysfs.c b/lib/sysfs.c index d14459b73..a87e9e3d0 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -653,9 +653,10 @@ int sysfs_scsi_get_hctl(struct sysfs_cxt *cxt, int *h, int *c, int *t, int *l) return len; buf[len] = '\0'; - hctl = strrchr(buf, '/') + 1; + hctl = strrchr(buf, '/'); if (!hctl) return -1; + hctl++; if (sscanf(hctl, "%d:%d:%d:%d", &cxt->scsi_host, &cxt->scsi_channel, &cxt->scsi_target, &cxt->scsi_lun) != 4) |