printf behaviour with illegal or malformed format string
Joseph Koshy
joseph.koshy at gmail.com
Mon Dec 12 08:16:40 PST 2005
phk> I'm leaning towards doing what phkmalloc has migrated to
phk> over time:
phk> Make a variable which can select between "normal/paranoia"
phk> and force it to paranoia for (uid==0 || gid==0 ||
phk> setuid || setgid).
phk> If the variable is set, a bogus format string will result
phk> in abort(2).
phk> If it is not set, the format string will be output
phk> unformatted in the message "WARNING: Illegal printf()
phk> format string: \"...\".
Why not just print the warning for both cases, and
stop interpreting the format string any further.
What do we gain by having a uid 0 process dump core?
--
FreeBSD Volunteer, http://people.freebsd.org/~jkoshy
More information about the freebsd-arch
mailing list