MD5 icon indicating copy to clipboard operation
MD5 copied to clipboard

Buffer-handling bug

Open luxagen opened this issue 6 years ago • 3 comments

I've just spent two days wondering why I couldn't get all the values generated by the library to match md5sum. I believe I've narrowed the problem down to a bug. Please see the attached image.

image

luxagen avatar Sep 19 '18 16:09 luxagen

Sorry if this report comes across as terse or abrupt - I'm working like a dog trying to make a deadline right now :-)

luxagen avatar Sep 19 '18 17:09 luxagen

Can you supply some values and the steps that you used to confirm this? I've looked at it quickly and it all appears to make sense...

CommanderBubble avatar Sep 20 '18 02:09 CommanderBubble

I'm not sure I can explain the problem any more. Looking at the above again, it seems like a small write will either complete a block at the head of the function (in which case the tail section will stash what's left in the buffer), or it won't, causing the head and mid sections to skip and the new write to concatenate into the buffer. The only way to hit the zero assignment is for the input data to run out, in which case it must have been consumed by the head and mid sections. This must be my mistake - sorry for the false alarm.

luxagen avatar Sep 20 '18 18:09 luxagen