Messages in this thread | | | Date | Wed, 22 Jun 2011 21:48:12 +0400 | From | Vasiliy Kulikov <> | Subject | Re: [PATCH] kernel: escape non-ASCII and control characters in printk() |
| |
On Wed, Jun 22, 2011 at 10:14 -0700, Joe Perches wrote: > On Wed, 2011-06-22 at 20:53 +0400, Vasiliy Kulikov wrote: > > On Wed, Jun 22, 2011 at 09:38 -0700, Joe Perches wrote: > > > > + if ((c >= ' ' && c < 127) || c == '\n') > > > if (isprint(c)) > > #define isprint(c) ((__ismask(c)&(_P|_U|_L|_D|_SP)) != 0) > > It slightly differs from what I've written. It (1) lacks '\n', > > You still need tab,
Correct.
> so: > > if (isprint(c) || isspace(c))
No, it also allows vertical tabs. Looking into __ctype only ' ', '\n' and '\t' should be allowed among all _S, so
if (isprint(c) || (c == '\n') || (c == '\t'))
Thanks,
-- Vasiliy Kulikov http://www.openwall.com - bringing security into open computing environments
| |