Commit b50e4e5
committed
Fix buffer underflow when serial peer spews garbage
A board I got spews garbage on hard reset. Sometimes that garbage is IAC
and it leads to len here getting negative and the loop eventually
underflows the buf.
Detect and avoid this silently.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>1 parent a94d4b8 commit b50e4e5
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | | - | |
| 309 | + | |
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
| |||
0 commit comments