[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20081028144234.35924bad.akpm@linux-foundation.org>
Date: Tue, 28 Oct 2008 14:42:34 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: David Rientjes <rientjes@...gle.com>
Cc: menage@...gle.com, linux-kernel@...r.kernel.org
Subject: Re: [patch] oom: print triggering task's cpuset and mems allowed
On Tue, 28 Oct 2008 09:08:15 -0700 (PDT)
David Rientjes <rientjes@...gle.com> wrote:
> +#define CPUSET_NAME_LEN (128)
> +#define CPUSET_NODELIST_LEN (256)
> +static char cpuset_name[CPUSET_NAME_LEN];
> +static char cpuset_nodelist[CPUSET_NODELIST_LEN];
>
> ...
>
> + snprintf(cpuset_name, CPUSET_NAME_LEN,
> + dentry ? (const char *)dentry->d_name.name : "/");
nit: this requires that the reviewer (and the maintainer) ensure that
CPUSET_NAME_LEN=sizeof(cpuset_name). This must be done manually and
introduces risk.
Better would be:
static char cpuset_name[128];
...
snprintf(cpuset_name, sizeof(cpuset_name), ...);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists