notwa/crc32 — pull request #2 by cojocar (2013-11-14 10:18:48+00:00)
Title: crc_be: bugfix: use only the last two bytes to index crc_table

Using the big endian option trigger an access to a uninitialised memory.

Valgrid output:

```
$ valgrind ./crc32 /tmp/data -e -r
==6935== Memcheck, a memory error detector
==6935== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==6935== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==6935== Command: ./crc32 /tmp/data -e -r
==6935==
==6935== Invalid read of size 8
==6935== at 0x401249: crc_be_cycle (crc32.c:45)
==6935== by 0x400CE6: cycle_file (main.c:149)
==6935== by 0x400E66: main (main.c:188)
==6935== Address 0x7fefff270 is not stack'd, malloc'd or (recently) free'd
==6935==
==6935== Use of uninitialised value of size 8
==6935== at 0x401249: crc_be_cycle (crc32.c:45)
==6935== by 0x400CE6: cycle_file (main.c:149)
==6935== by 0x400E66: main (main.c:188)
==6935==
D597CB94
==6935==
==6935== HEAP SUMMARY:
==6935== in use at exit: 0 bytes in 0 blocks
==6935== total heap usage: 2 allocs, 2 frees, 584 bytes allocated
==6935==
==6935== All heap blocks were freed -- no leaks are possible
==6935==
==6935== For counts of detected and suppressed errors, rerun with: -v
==6935== Use --track-origins=yes to see where uninitialised values come from
==6935== ERROR SUMMARY: 103735 errors from 2 contexts (suppressed: 2 from 2)
```