[apparmor] [PATCH 2/5] Add the ability to read proc attr interfaces

Kees Cook kees.cook at canonical.com
Fri Jul 22 01:57:54 UTC 2011


Hi John,

On Thu, Jul 21, 2011 at 11:16:35AM -0700, John Johansen wrote:
> +int aa_getprocattr(pid_t tid, const char *attr, char **buf, char **mode)
> +{
> +	int rc, size = INITIAL_GUESS_SIZE/2;
> +	char *buffer = NULL;

How about doing a buf!=NULL test here just to be extra defensive?

-Kees


-- 
Kees Cook
Ubuntu Security Team



More information about the AppArmor mailing list