Don't assume the result of read()

added by DotNetKicks
1/20/2022 3:54:35 PM

276 Views

I read this post and it took me very little time to spot a pretty nasty bug. Here is the relevant section: The bug is on line #4. The code assumes that a call to read() will return less than the requested number of bytes only at the end of the file.


0 comments