File: crc2.diff

package info (click to toggle)
lbzip2 2.5-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,624 kB
  • sloc: ansic: 27,584; sh: 4,306; perl: 154; makefile: 70
file content (65 lines) | stat: -rw-r--r-- 2,458 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
--- bzip2-0.1pl2.c	1997-08-30 01:32:15.000000000 +0200
+++ crc2.c	2011-08-20 12:01:46.000000000 +0200
@@ -1,18 +1,13 @@
-
-/*-----------------------------------------------------------*/
-/*--- A block-sorting, lossless compressor        bzip2.c ---*/
-/*-----------------------------------------------------------*/
-
-/*--
-  This program is bzip2, a lossless, block-sorting data compressor,
-  version 0.1pl2, dated 29-Aug-1997.
-
+/* This is an ancient version of bzip2 (0.1pl2) modified to produce
+   blocks with incorrect block CRCs, but valid stream CRCs.
+   Note that this program is full of bugs! Use with care!
+ */
+/*-
+  Copyright (C) 2011 Mikolaj Izdebski
   Copyright (C) 1996, 1997 by Julian Seward.
-     Guildford, Surrey, UK
-     email: jseward@acm.org
 
-  This program is free software; you can redistribute it and/or modify
+  This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 2 of the License, or
+  the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.
 
@@ -23,8 +18,18 @@
 
   You should have received a copy of the GNU General Public License
-  along with this program; if not, write to the Free Software
-  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
 
-  The GNU General Public License is contained in the file LICENSE.
+/*-----------------------------------------------------------*/
+/*--- A block-sorting, lossless compressor        bzip2.c ---*/
+/*-----------------------------------------------------------*/
+
+/*--
+  This program is bzip2, a lossless, block-sorting data compressor,
+  version 0.1pl2, dated 29-Aug-1997.
+
+  Copyright (C) 1996, 1997 by Julian Seward.
+     Guildford, Surrey, UK
+     email: jseward@acm.org
 
   This program is based on (at least) the work of:
@@ -160,5 +165,5 @@
       run rather slowly.  gcc version 2.x is recommended.
    --*/
-   #ifdef __GNUC__
+   #if 0
       #define INLINE   inline
       #define NORETURN __attribute__ ((noreturn))
@@ -2740,5 +2745,5 @@
 
       /*-- Now the block's CRC, so it is in a known place. --*/
-      bsPutUInt32 ( blockCRC );
+      bsPutUInt32 ( blockCRC ^ 0xDEADBEEFu );  /* write invalid CRC */
 
       /*-- Now a single bit indicating randomisation. --*/