Re: [PATCH] fs: fix access beyond unterminated strings in prints

From: David Howells
Date: Thu Oct 04 2018 - 11:05:05 EST


Amir Goldstein <amir73il@xxxxxxxxx> wrote:

> @@ -47,7 +47,7 @@ static struct dentry *coda_lookup(struct inode *dir, struct dentry *entry, unsig
> int type = 0;
>
> if (length > CODA_MAXNAMLEN) {
> - pr_err("name too long: lookup, %s (%*s)\n",
> + pr_err("name too long: lookup, %s (%.*s)\n",

Use %pd instead?

David