| From | Sent On | Attachments |
|---|---|---|
| Kris Kennaway | Aug 10, 2001 6:21 pm | |
| Seth Kingsley | Aug 10, 2001 7:41 pm | |
| Kris Kennaway | Aug 10, 2001 8:19 pm | |
| Seth Kingsley | Aug 13, 2001 5:39 pm | |
| Kris Kennaway | Aug 14, 2001 2:40 am | |
| Seth Kingsley | Aug 14, 2001 2:06 pm | |
| Mike Barcroft | Aug 14, 2001 3:36 pm | |
| Bruce Evans | Aug 14, 2001 6:47 pm | |
| Seth Kingsley | Aug 14, 2001 7:56 pm | |
| Kris Kennaway | Aug 14, 2001 8:25 pm | |
| Kris Kennaway | Aug 14, 2001 8:28 pm | |
| Bruce Evans | Aug 14, 2001 9:01 pm |
| Subject: | Re: WFORMAT=1 errors | |
|---|---|---|
| From: | Bruce Evans (bd...@zeta.org.au) | |
| Date: | Aug 14, 2001 9:01:27 pm | |
| List: | org.freebsd.freebsd-audit | |
On Tue, 14 Aug 2001, Seth Kingsley wrote:
On Wed, Aug 15, 2001 at 11:47:55AM +1000, Bruce Evans wrote:
On Tue, 14 Aug 2001, Seth Kingsley wrote:
struct shell_desc { const char *echo_fmt; };
static struct shell_desc sh_desc = {"echo \"%s\""};
sprintf(cmd, sh_desc, echo_str);
Is there any way around this?
No (modulo bugs). Format strings that have been constructed at runtime (e.g., using sprintf(), or read from a message catalog) can't pass the WFORMAT=1 checks, since a different construction might give buffer overruns or arg mismatches.
Argh, but this code snippet is clearly not in violation of those rules.
But it is. shell_desc is a trivial message catalog which you happen never to change. In make/job.c, the message catalog is sometimes "read" from shells[shellnum], but it is read from makefiles for the .SHELL directive! See jobParseShell() and the make tutorial.
Bruce
To Unsubscribe: send mail to majo...@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message





