summarylogtreecommitdiffstats
path: root/51-fix-hardening-build.patch
blob: 1a39a6cef6c7b4f66f3c6229173548089bbb90f9 (plain)
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
From: Simon Ruderich <simon@ruderich.org>
Subject: Fix compile with hardening flags
Last-Update: 2012-03-22

The problem is that strlen() is a functions name and optimization -O2 isn't
smart about it. Change name to strlength.

Index: fondu-0.0.20060102/fondu.c
===================================================================
--- fondu-0.0.20060102.orig/fondu.c	2012-03-22 18:12:48.373669831 +0100
+++ fondu-0.0.20060102/fondu.c	2012-03-22 18:12:57.577670181 +0100
@@ -473,7 +473,7 @@
 	}
 	if ( styleoff!=0 ) {
 	    unsigned char stringoffsets[48];
-	    int strcnt, strlen, format;
+	    int strcnt, strlength, format;
 	    char **strings, *pt;
 	    fseek(f,styleoff,SEEK_SET);
 	    /* class = */ getushort(f);
@@ -484,11 +484,11 @@
 	    strcnt = getushort(f);
 	    strings = malloc(strcnt*sizeof(char *));
 	    for ( j=0; j<strcnt; ++j ) {
-		strlen = getc(f);
-		strings[j] = malloc(strlen+2);
-		strings[j][0] = strlen;
-		strings[j][strlen+1] = '\0';
-		for ( k=0; k<strlen; ++k )
+		strlength = getc(f);
+		strings[j] = malloc(strlength+2);
+		strings[j][0] = strlength;
+		strings[j][strlength+1] = '\0';
+		for ( k=0; k<strlength; ++k )
 		    strings[j][k+1] = getc(f);
 	    }
 	    for ( j=0; j<48; ++j ) {
@@ -498,11 +498,11 @@
 		if ( k!=-1 || stringoffsets[j]==0 )
 	    continue;		/* this style doesn't exist */
 		format = stringoffsets[j]-1;
-		strlen = strings[0][0];
+		strlength = strings[0][0];
 		if ( format!=0 && format!=-1 )
 		    for ( k=0; k<strings[format][0]; ++k )
-			strlen += strings[ strings[format][k+1]-1 ][0];
-		pt = cur->psnames[j] = malloc(strlen+1);
+			strlength += strings[ strings[format][k+1]-1 ][0];
+		pt = cur->psnames[j] = malloc(strlength+1);
 		strcpy(pt,strings[ 0 ]+1);
 		pt += strings[ 0 ][0];
 		if ( format!=0 && format!=-1 )