]> git.proxmox.com Git - mirror_zfs.git/commit
Fix: Array bounds read in zprop_print_one_property()
authorGeLiXin <ge.lixin@zte.com.cn>
Mon, 22 Aug 2016 03:20:22 +0000 (11:20 +0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 22 Aug 2016 17:23:47 +0000 (10:23 -0700)
commit23827a4ca1fbbc95d58398a2ff65dc73e4605ab8
tree8a7739079661f9de705784eddb3ef9ee6d141c04
parent9cc1844a1dab9cb62743f1f31eca73fcc6aaf0c4
Fix: Array bounds read in zprop_print_one_property()

If the loop index i comes to (ZFS_GET_NCOLS - 1), the cbp->cb_columns[i + 1]
actually read the data of cbp->cb_colwidths[0], which means the array
subscript is above array bounds.

Luckily the cbp->cb_colwidths[0] is always 0 and it seems we haven't
looped enough times to exceed the array bounds so far, but it's really
a secluded risk someday.

Signed-off-by: GeLiXin <ge.lixin@zte.com.cn>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #5003
lib/libzfs/libzfs_util.c [changed mode: 0644->0755]