Gentoo Archives: gentoo-commits

From: "Christoph Mende (angelos)" <angelos@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in media-sound/pwavecat/files: pwavecat-0.4.5-overflow.patch
Date: Sat, 07 May 2011 17:23:05
Message-Id: 20110507172254.F1C3820054@flycatcher.gentoo.org
1 angelos 11/05/07 17:22:54
2
3 Added: pwavecat-0.4.5-overflow.patch
4 Log:
5 Fix possible overflows (bug #340167)
6
7 (Portage version: 2.2.0_alpha31/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 media-sound/pwavecat/files/pwavecat-0.4.5-overflow.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-sound/pwavecat/files/pwavecat-0.4.5-overflow.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-sound/pwavecat/files/pwavecat-0.4.5-overflow.patch?rev=1.1&content-type=text/plain
14
15 Index: pwavecat-0.4.5-overflow.patch
16 ===================================================================
17 diff --git a/parts.c b/parts.c
18 index 670d0d5..a59ad98 100644
19 --- a/parts.c
20 +++ b/parts.c
21 @@ -338,10 +338,10 @@ if(! file_header)
22 return 0;
23 }
24
25 -strcpy(file_header -> main_chunk, "RIFF");
26 +memcpy(file_header -> main_chunk, "RIFF", 4);
27 file_header -> length = length + header_size - 8;
28 -strcpy(file_header -> chunk_type, "WAVE");
29 -strcpy(file_header -> sub_chunk, "fmt "); // watch out the zero termination overwrites next var
30 +memcpy(file_header -> chunk_type, "WAVE", 4);
31 +memcpy(file_header -> sub_chunk, "fmt ", 4); // watch out the zero termination overwrites next var
32 file_header -> length_chunk = 16; //always 16
33 file_header -> format = 1; //PCM
34 file_header -> modus = modus; // stereo
35 @@ -349,7 +349,7 @@ file_header -> sample_fq = sample_fq; // 44100, 48000, etc...
36 file_header -> byte_p_sec = byte_p_sec; // little endian
37 file_header -> byte_p_spl = byte_p_spl; // 4 stereo
38 file_header -> bit_p_spl = bit_p_spl; // 16 bits
39 -strcpy(file_header -> data_chunk, "data"); // watch out the zero termination overwrites next var
40 +memcpy(file_header -> data_chunk, "data", 4); // watch out the zero termination overwrites next var
41 file_header -> data_length = (unsigned long)length;
42
43 if(debug_flag)