]> granicus.if.org Git - zfs/commit
Prevent pointer to an out-of-scope local variable
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Fri, 21 Jun 2019 01:31:53 +0000 (10:31 +0900)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 21 Jun 2019 01:31:52 +0000 (18:31 -0700)
commit9585497208266a917513754f887d9db35efdcec7
tree8f6c5797f5b407d804bd2c22efe601e799e10bb4
parentaccd6d9dc411b150d5313b2e777381f13da8861b
Prevent pointer to an out-of-scope local variable

`show_str` could be a pointer to a local variable in stack
which is out-of-scope by the time
`return (snprintf(buf, buflen, "%s\n", show_str));`
is called.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
Closes #8924
Closes #8940
module/zfs/zfs_sysfs.c