[PATCH] 9p: null terminate error strings for debug print
authorEric Van Hensbergen <ericvh@gmail.com>
Fri, 26 Jan 2007 08:57:06 +0000 (00:57 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Fri, 26 Jan 2007 21:51:00 +0000 (13:51 -0800)
We weren't properly NULL terminating protocol error strings for our debug
printk resulting in garbage being included in the output when debug was
enabled.

Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/9p/error.c

index ae91555c155894be0b0118bc075e095ae01b5262..0d7fa4e08812b85367e290ebf933ea50306ac2a6 100644 (file)
@@ -83,6 +83,7 @@ int v9fs_errstr2errno(char *errstr, int len)
 
        if (errno == 0) {
                /* TODO: if error isn't found, add it dynamically */
+               errstr[len] = 0;
                printk(KERN_ERR "%s: errstr :%s: not found\n", __FUNCTION__,
                       errstr);
                errno = 1;