Skip to content
Commit a3b2c8c7 authored by Mathias Krause's avatar Mathias Krause Committed by Greg Kroah-Hartman
Browse files

debugfs: write_file_bool() - ensure strtobool() operates on valid data



In case, userland writes an empty string to a bool debugfs file, buf[]
will still be uninitialized when being passed to strtobool() making the
outcome of that function purely random.

Fix this by always zero-terminating the buffer.

Signed-off-by: default avatarMathias Krause <minipli@googlemail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3a76e5e0
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment