Re: bug#35137: [df] incorrect parsing of /proc/self/mountinfo with \r in mount path

2019-04-10 Thread Zbigniew Jędrzejewski-Szmek
Hi, I don't know this codebase, so can't comment on the patch, but the same bug in util-linux was solved by ditching scanf. https://github.com/karelzak/util-linux/commit/e902609400a861dbdb47d5c3eb98b951530bf01d

Re: bug#35137: [df] incorrect parsing of /proc/self/mountinfo with \r in mount path

2019-04-10 Thread Bernhard Voelker
On 4/10/19 4:15 AM, Paul Eggert wrote: > Bernhard Voelker wrote: > > +/* Find the next white space in STR, terminate the string there in place, > + and return that position. Otherwise return NULL. */ > + > +static char * > +terminate_at_blank (char const *str) > +{ > + char *s = NULL; > +

Re: bug#35137: [df] incorrect parsing of /proc/self/mountinfo with \r in mount path

2019-04-09 Thread Paul Eggert
Bernhard Voelker wrote: +/* Find the next white space in STR, terminate the string there in place, + and return that position. Otherwise return NULL. */ + +static char * +terminate_at_blank (char const *str) +{ + char *s = NULL; + if ((s = strchr (str, ' ')) != NULL) +*s = '\0'; +

Re: bug#35137: [df] incorrect parsing of /proc/self/mountinfo with \r in mount path

2019-04-09 Thread Bernhard Voelker
[adding gnulib, coming from https://bugs.gnu.org/35137] On 4/5/19 9:01 AM, Bernhard Voelker wrote: > On 4/4/19 9:52 AM, Zbigniew Jędrzejewski-Szmek wrote: >> See https://github.com/systemd/systemd/issues/12018 and >> https://github.com/karelzak/util-linux/issues/780 for additional context. >> >>