[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [PATCH] avoid assuming MAXPATHLEN in config(8)


On Thu, Jul 07, 2011 at 11:33:53AM +0200, Robert Millan wrote:

> -	(void)snprintf(fname, sizeof fname, "../../conf/options.%s",
> +	(void)asprintf(&fname, "../../conf/options.%s",
>  	    machinename);

Ignoring the return value of asprintf() is not a good idea, as it can
indicate a failed allocation.

On a related note, the return value of strdup() also should be checked.


Reply to: