hn • r/hackernews
Comment on: When random.bytes() runs but doesn't work
I have absolutely no interest in defending this code-- and already considered it untrusthworthy before any of this. But in the interest of accuracy:> It does a memcpy of a minimum of 4 bytesThis is a common misreading of MIN(). MIN(4,x) is a number that is a MAXIMUM of 4, not a minimum.Count is the number of bytes remaining in the buffer. The input to the copy is a 4-byte word. min(4,count) will produce a number 0-4 which is always equal to or less than count. The copy will not overflow the buffer or overrun the input: If count is 3, for example, then here will be 3 and it will copy 3 byt