forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
xastir-2.0.4-fortify.diff
144 lines (118 loc) · 4.3 KB
/
xastir-2.0.4-fortify.diff
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
--- src/rac_data.c.orig 2012-09-23 18:19:22.000000000 +0200
+++ src/rac_data.c 2012-11-29 21:00:53.000000000 +0100
@@ -212,7 +212,8 @@
char char_offset[16];
char index[32];
int found = 0;
- rac_record racdata;
+ char buffer[sizeof(rac_record)];
+ rac_record *racdata = (rac_record *)buffer;
/*char filler[8];*/
char amacall_path[MAX_VALUE];
@@ -220,7 +221,7 @@
xastir_snprintf(index, sizeof(index)," ");
- xastir_snprintf(racdata.callsign, sizeof(racdata.callsign)," ");
+ xastir_snprintf(racdata->callsign, sizeof(racdata->callsign)," ");
/* ==================================================================== */
/* Search thru the index, get the RBA */
@@ -257,19 +258,19 @@
if (callsign[5] == '-')
(void)chomp(callsign,5);
- while (!feof(fdb) && strncmp((char *)&racdata, callsign, 6) < 0)
+ while (!feof(fdb) && strncmp(buffer, callsign, 6) < 0)
//WE7U
// Problem here: We're sticking 8 bytes too many into racdata!
- rc = fgets((char *)&racdata, sizeof(racdata), fdb);
+ rc = fgets(buffer, sizeof(buffer), fdb);
} else
fprintf(stderr,"Search:Could not open RAC data base: %s\n", get_data_base_dir("fcc/AMACALL.LST") );
/* || (callsign[5] == '-' && strncmp((char *)&racdata,callsign,5) < 0)) */
- (void)chomp(racdata.callsign, 6);
+ (void)chomp(racdata->callsign, 6);
- if (!strncmp((char *)racdata.callsign, callsign, 6)) {
+ if (!strncmp(racdata->callsign, callsign, 6)) {
found = 1;
// Some of these cause problems on 64-bit processors, so commented
@@ -293,82 +294,82 @@
xastir_snprintf(data->callsign,
sizeof(data->callsign),
"%s",
- racdata.callsign);
+ racdata->callsign);
xastir_snprintf(data->first_name,
sizeof(data->first_name),
"%s",
- racdata.first_name);
+ racdata->first_name);
xastir_snprintf(data->last_name,
sizeof(data->last_name),
"%s",
- racdata.last_name);
+ racdata->last_name);
xastir_snprintf(data->address,
sizeof(data->address),
"%s",
- racdata.address);
+ racdata->address);
xastir_snprintf(data->city,
sizeof(data->city),
"%s",
- racdata.city);
+ racdata->city);
xastir_snprintf(data->province,
sizeof(data->province),
"%s",
- racdata.province);
+ racdata->province);
xastir_snprintf(data->postal_code,
sizeof(data->postal_code),
"%s",
- racdata.postal_code);
+ racdata->postal_code);
xastir_snprintf(data->qual_a,
sizeof(data->qual_a),
"%s",
- racdata.qual_a);
+ racdata->qual_a);
xastir_snprintf(data->qual_b,
sizeof(data->qual_b),
"%s",
- racdata.qual_b);
+ racdata->qual_b);
xastir_snprintf(data->qual_c,
sizeof(data->qual_c),
"%s",
- racdata.qual_c);
+ racdata->qual_c);
xastir_snprintf(data->qual_d,
sizeof(data->qual_d),
"%s",
- racdata.qual_d);
+ racdata->qual_d);
xastir_snprintf(data->club_name,
sizeof(data->club_name),
"%s",
- racdata.club_name);
+ racdata->club_name);
xastir_snprintf(data->club_address,
sizeof(data->club_address),
"%s",
- racdata.club_address);
+ racdata->club_address);
xastir_snprintf(data->club_city,
sizeof(data->club_city),
"%s",
- racdata.club_city);
+ racdata->club_city);
xastir_snprintf(data->club_province,
sizeof(data->club_province),
"%s",
- racdata.club_province);
+ racdata->club_province);
xastir_snprintf(data->club_postal_code,
sizeof(data->club_postal_code),
"%s",
- racdata.club_postal_code);
+ racdata->club_postal_code);
}
(void)fclose(fdb);