mirror of
https://github.com/vattam/BSDGames.git
synced 2025-12-20 10:54:48 +00:00
adventure: Fix crc code to not segfault on 64 bit architectures. Closes: #477768
This commit is contained in:
@@ -42,6 +42,8 @@ __RCSID("$NetBSD: crc.c,v 1.8 2003/08/07 09:36:50 agc Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#include "extern.h"
|
||||
|
||||
const unsigned long crctab[] = {
|
||||
@@ -125,7 +127,7 @@ crc(ptr, nr) /* Process nr bytes at a time; ptr points to them */
|
||||
|
||||
while (nr > 0)
|
||||
for (p = ptr; nr--; ++p) {
|
||||
if (!(i = crcval >> 24 ^ *p)) {
|
||||
if (!(i = crcval >> (sizeof(crcval) * CHAR_BIT - 8) ^ *p)) {
|
||||
i = step++;
|
||||
if (step >= sizeof(crctab) / sizeof(crctab[0]))
|
||||
step = 0;
|
||||
|
||||
2
debian/changelog
vendored
2
debian/changelog
vendored
@@ -1,6 +1,8 @@
|
||||
bsdgames (2.17-15) UNRELEASED; urgency=low
|
||||
|
||||
* Include rot13 in package description. Closes: #477141
|
||||
* adventure: Fix crc code to not segfault on 64 bit architectures.
|
||||
Closes: #477768
|
||||
|
||||
-- Joey Hess <joeyh@debian.org> Mon, 21 Apr 2008 12:37:44 -0400
|
||||
|
||||
|
||||
Reference in New Issue
Block a user