Browse Source

[PATCH] 9p: null terminate error strings for debug print

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>
Eric Van Hensbergen 18 years ago
parent
commit
e540eb45a5
1 changed files with 1 additions and 0 deletions
  1. 1 0
      fs/9p/error.c

+ 1 - 0
fs/9p/error.c

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