[PATCH] avoid assuming MAXPATHLEN in config(8)
olafBuddenhagen at gmx.net
olafBuddenhagen at gmx.net
Sun Sep 4 23:04:47 UTC 2011
Hi,
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.
-antrik-
More information about the freebsd-hackers
mailing list