[PATCH] 2.6.19-rc2-mm2 sysfs: sysfs_write_file() writes zero terminated data
From: Thomas Maier
Date: Sun Oct 22 2006 - 13:15:56 EST
Hello,
since most of the files in sysfs are text files,
it would be nice, if the "store" function called
during sysfs_write_file() gets a zero terminated
string / data.
The current implementation seems not to ensure this.
(But only if it is the first time the zeroed buffer
page is allocated.)
So the buffer can be scanned by sscanf() easily,
for example.
This patch simply sets a \0 char behind the
data in buffer->page.
Signed-off-by: Thomas Maier <balagi@xxxxxxxxxxx>Attachment:
sysfs_write_file-zero-term-string.patch
Description: Binary data