Re: [PATCH] drm/tinydrm: fix a loop in debugfs code

2019-08-26 Thread Noralf Trønnes
Den 21.08.2019 09.24, skrev Dan Carpenter: > This code will likely crash if we try to do a zero byte write. The code > looks like this: > > /* strip trailing whitespace */ > for (i = count - 1; i > 0; i--) > if (isspace(buf[i])) > ... > >

[PATCH] drm/tinydrm: fix a loop in debugfs code

2019-08-21 Thread Dan Carpenter
This code will likely crash if we try to do a zero byte write. The code looks like this: /* strip trailing whitespace */ for (i = count - 1; i > 0; i--) if (isspace(buf[i])) ... We're writing zero bytes so count = 0. You would think that