bitmaintech/cgminer — pull request #1 by fractalbc (2014-01-01 23:06:19+00:00)
Title: Don't overflow nonce when copying from nonce_bin

nonce is a uint32_t which is 4 bytes. nonce_bin is BMSC_READ_SIZE bytes (5). Copying 5 bytes into a 4 byte variable crashes on 64 bit ubuntu 12.04 and probably other platforms. Only 4 bytes are used following the copy so restricting the copy to sizeof(unit32_t) is probably the desired action.

A sample of values returned by bmsc_get_nonce shows the 5th byte always contains 0x80 and is never used.