diff --git a/[refs] b/[refs] index 81d96d6e8fad..bf7f20c9326f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 06a4bcae1ff2cd5f6f42bd74add85ec785a26343 +refs/heads/master: 035ed7a49447bc8e15d4d9316fc6a359b2d94333 diff --git a/trunk/fs/sysfs/file.c b/trunk/fs/sysfs/file.c index 298303b5a716..95c165101c98 100644 --- a/trunk/fs/sysfs/file.c +++ b/trunk/fs/sysfs/file.c @@ -190,6 +190,9 @@ fill_write_buffer(struct sysfs_buffer * buffer, const char __user * buf, size_t count = PAGE_SIZE - 1; error = copy_from_user(buffer->page,buf,count); buffer->needs_read_fill = 1; + /* if buf is assumed to contain a string, terminate it by \0, + so e.g. sscanf() can scan the string easily */ + buffer->page[count] = 0; return error ? -EFAULT : count; }