Re: [PATCH v2] proc: add missing '\0' back to /proc/$pid/cmdline

2018-06-19 Thread Alexey Dobriyan
On Tue, Jun 19, 2018 at 06:28:40PM +0200, Michal Kubecek wrote: > Recent rewrite introduced a regression, /proc/$pid/cmdline is missing the > trailing null character: > > mike@lion:/tmp> cat /proc/self/cmdline | od -t c > 000 c a t \0 / p r o c / s e l f / c > 00

[PATCH v2] proc: add missing '\0' back to /proc/$pid/cmdline

2018-06-19 Thread Michal Kubecek
Recent rewrite introduced a regression, /proc/$pid/cmdline is missing the trailing null character: mike@lion:/tmp> cat /proc/self/cmdline | od -t c 000 c a t \0 / p r o c / s e l f / c 020 m d l i n e 026 This is because strnlen() is used to