File: enhance_sprintf_buffer.patch

package info (click to toggle)
gff2aplot 2.0-13
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,576 kB
  • sloc: perl: 5,378; ansic: 806; makefile: 120; javascript: 93; sh: 41
file content (47 lines) | stat: -rw-r--r-- 1,555 bytes parent folder | download | duplicates (4)
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
Author: Andreas Tille <tille@debian.org>
Last-Update: Mon, 10 Dec 2018 07:36:57 +0100
Description: Enhance print buffer to avoid:
  /usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: '__builtin___sprintf_chk' output between 36 and 3418 bytes into a destination of size 1000
 Finally this patch is not fully working since the enhanced buffers
 make sprint assume that even larger buffers are needed.

--- a/src/ali2gff/ali2gff.c
+++ b/src/ali2gff/ali2gff.c
@@ -234,7 +234,7 @@ void processGFFfile() {
 	unsigned long int yseqLen_4 = LONG_MAX;
 	
 	float score;
-	char scores[MAXSTRING];
+	char scores[2*MAXSTRING];
 	
 	char strand1;
 	char strand2;
@@ -426,8 +426,8 @@ void processMumfile() {
 	time_t now;
 	char nowString[100];
 	
-	char nextMUM[MAXSTRING] = "";
-	char nextGAP[MAXSTRING] = "";
+	char nextMUM[5*MAXSTRING] = "";
+	char nextGAP[3*MAXSTRING] = "";
 	
 	
 	char seq1[MAX_SEQUENCE_LENGTH];
@@ -974,7 +974,7 @@ void processSimfile() {
 	FILE *simfile;
 
 	char line[MAXSTRING];							/*----- read line 		-----*/
-	char seqboundsline[MAXSTRING];
+	char seqboundsline[2*MAXSTRING];
 	char *ptr;										/*----- pointer to line -----*/
 	char waste[MAXSTRING];
 	
@@ -1000,7 +1000,7 @@ void processSimfile() {
 	unsigned long int yrev; 			/* start position + end position of y sequence --- this term is used to calculate positions of rev. compl. fragments on forward strand */   			
 	
 	unsigned short int aliPrinted = 0;
-	char aliPrintString[MAXSTRING];
+	char aliPrintString[4*MAXSTRING];
 
 		
 	/*----- open alignment file -----*/