Secure Coding Standard » History » Version 20
Andreas Steffen, 02.06.2013 18:28
1 | 1 | Andreas Steffen | h1. Secure Coding Standard |
---|---|---|---|
2 | 1 | Andreas Steffen | |
3 | 7 | Andreas Steffen | The strongSwan project adheres to the following recommendations and rules proposed by the "CERT C Secure Coding Standard":https://www.securecoding.cert.org/confluence/display/seccode/CERT+C+Secure+Coding+Standard: |
4 | 1 | Andreas Steffen | |
5 | 10 | Andreas Steffen | {{>toc}} |
6 | 10 | Andreas Steffen | |
7 | 18 | Andreas Steffen | (This is work under progress. Through inspection of our code the _Check Adherence_ items must be assigned to one of the other three categories first. Then we intend to move recommendations and rules of the _Partial Adherence_ category to _Full Adherence_ by fixing our code in those places where we don't adhere yet) |
8 | 18 | Andreas Steffen | |
9 | 1 | Andreas Steffen | h2. Preprocessor (PRE) |
10 | 1 | Andreas Steffen | |
11 | 13 | Andreas Steffen | _Full Adherence_ |
12 | 2 | Andreas Steffen | |
13 | 2 | Andreas Steffen | * "PRE03-C. Prefer typedefs to defines for encoding types":https://www.securecoding.cert.org/confluence/display/seccode/PRE03-C.+Prefer+typedefs+to+defines+for+encoding+types |
14 | 2 | Andreas Steffen | |
15 | 2 | Andreas Steffen | * "PRE04-C. Do not reuse a standard header file name":https://www.securecoding.cert.org/confluence/display/seccode/PRE04-C.+Do+not+reuse+a+standard+header+file+name |
16 | 2 | Andreas Steffen | |
17 | 3 | Andreas Steffen | * "PRE06-C. Enclose header files in an inclusion guard":https://www.securecoding.cert.org/confluence/display/seccode/PRE06-C.+Enclose+header+files+in+an+inclusion+guard |
18 | 3 | Andreas Steffen | |
19 | 4 | Andreas Steffen | * "PRE09-C. Do not replace secure functions with deprecated or obsolescent functions":https://www.securecoding.cert.org/confluence/display/seccode/PRE09-C.+Do+not+replace+secure+functions+with+deprecated+or+obsolescent+functions |
20 | 4 | Andreas Steffen | |
21 | 13 | Andreas Steffen | _Partial Adherence_ |
22 | 2 | Andreas Steffen | |
23 | 2 | Andreas Steffen | * "PRE00-C. Prefer inline or static functions to function-like macros ":https://www.securecoding.cert.org/confluence/display/seccode/PRE00-C.+Prefer+inline+or+static+functions+to+function-like+macros |
24 | 2 | Andreas Steffen | |
25 | 2 | Andreas Steffen | * "PRE01-C. Use parentheses within macros around parameter names":https://www.securecoding.cert.org/confluence/display/seccode/PRE01-C.+Use+parentheses+within+macros+around+parameter+names |
26 | 2 | Andreas Steffen | |
27 | 2 | Andreas Steffen | * "PRE02-C. Macro replacement lists should be parenthesized":https://www.securecoding.cert.org/confluence/display/seccode/PRE02-C.+Macro+replacement+lists+should+be+parenthesized |
28 | 3 | Andreas Steffen | |
29 | 13 | Andreas Steffen | _Check Adherence_ |
30 | 3 | Andreas Steffen | |
31 | 3 | Andreas Steffen | * "PRE05-C. Understand macro replacement when concatenating tokens or performing stringification":https://www.securecoding.cert.org/confluence/display/seccode/PRE05-C.+Understand+macro+replacement+when+concatenating+tokens+or+performing+stringification |
32 | 3 | Andreas Steffen | |
33 | 1 | Andreas Steffen | * "PRE07-C. Avoid using repeated question marks":https://www.securecoding.cert.org/confluence/display/seccode/PRE07-C.+Avoid+using+repeated+question+marks |
34 | 4 | Andreas Steffen | |
35 | 4 | Andreas Steffen | * "PRE10-C. Wrap multistatement macros in a do-while loop":https://www.securecoding.cert.org/confluence/display/seccode/PRE10-C.+Wrap+multistatement+macros+in+a+do-while+loop |
36 | 4 | Andreas Steffen | |
37 | 4 | Andreas Steffen | * "PRE11-C. Do not conclude macro definitions with a semicolon ":https://www.securecoding.cert.org/confluence/display/seccode/PRE11-C.+Do+not+conclude+macro+definitions+with+a+semicolon |
38 | 4 | Andreas Steffen | |
39 | 4 | Andreas Steffen | * "PRE12-C. Do not define unsafe macros":https://www.securecoding.cert.org/confluence/display/seccode/PRE12-C.+Do+not+define+unsafe+macros |
40 | 4 | Andreas Steffen | |
41 | 4 | Andreas Steffen | * "PRE30-C. Do not create a universal character name through concatenation":https://www.securecoding.cert.org/confluence/display/seccode/PRE30-C.+Do+not+create+a+universal+character+name+through+concatenation |
42 | 4 | Andreas Steffen | |
43 | 4 | Andreas Steffen | * "PRE31-C. Avoid side-effects in arguments to unsafe macros":https://www.securecoding.cert.org/confluence/display/seccode/PRE31-C.+Avoid+side-effects+in+arguments+to+unsafe+macros |
44 | 4 | Andreas Steffen | |
45 | 4 | Andreas Steffen | * "PRE32-C. Do not use preprocessor directives inside macro arguments":https://www.securecoding.cert.org/confluence/display/seccode/PRE32-C.+Do+not+use+preprocessor+directives+inside+macro+arguments |
46 | 3 | Andreas Steffen | |
47 | 13 | Andreas Steffen | _No Adherence_ |
48 | 3 | Andreas Steffen | |
49 | 3 | Andreas Steffen | * "PRE08-C. Guarantee that header file names are unique":https://www.securecoding.cert.org/confluence/display/seccode/PRE08-C.+Guarantee+that+header+file+names+are+unique |
50 | 2 | Andreas Steffen | |
51 | 1 | Andreas Steffen | h2. Declarations and Initialization (DCL) |
52 | 1 | Andreas Steffen | |
53 | 13 | Andreas Steffen | _Full Adherence_ |
54 | 6 | Andreas Steffen | |
55 | 6 | Andreas Steffen | * "DCL01-C. Do not reuse variable names in subscopes":https://www.securecoding.cert.org/confluence/display/seccode/DCL01-C.+Do+not+reuse+variable+names+in+subscopes |
56 | 6 | Andreas Steffen | |
57 | 6 | Andreas Steffen | * "DCL02-C. Use visually distinct identifiers":https://www.securecoding.cert.org/confluence/display/seccode/DCL02-C.+Use+visually+distinct+identifiers |
58 | 6 | Andreas Steffen | |
59 | 8 | Andreas Steffen | * "DCL05-C. Use typedefs to improve code readability":https://www.securecoding.cert.org/confluence/display/seccode/DCL05-C.+Use+typedefs+to+improve+code+readability |
60 | 8 | Andreas Steffen | |
61 | 8 | Andreas Steffen | * "DCL07-C. Include the appropriate type information in function declarators":https://www.securecoding.cert.org/confluence/display/seccode/DCL07-C.+Include+the+appropriate+type+information+in+function+declarators |
62 | 8 | Andreas Steffen | |
63 | 8 | Andreas Steffen | * "DCL12-C. Implement abstract data types using opaque types":https://www.securecoding.cert.org/confluence/display/seccode/DCL12-C.+Implement+abstract+data+types+using+opaque+types |
64 | 8 | Andreas Steffen | |
65 | 8 | Andreas Steffen | * "DCL15-C. Declare file-scope objects or functions that do not need external linkage as static":https://www.securecoding.cert.org/confluence/display/seccode/DCL15-C.+Declare+file-scope+objects+or+functions+that+do+not+need+external+linkage+as+static |
66 | 8 | Andreas Steffen | |
67 | 8 | Andreas Steffen | * "DCL18-C. Do not begin integer constants with 0 when specifying a decimal value":https://www.securecoding.cert.org/confluence/display/seccode/DCL18-C.+Do+not+begin+integer+constants+with+0+when+specifying+a+decimal+value |
68 | 8 | Andreas Steffen | |
69 | 8 | Andreas Steffen | * "DCL31-C. Declare identifiers before using them":https://www.securecoding.cert.org/confluence/display/seccode/DCL31-C.+Declare+identifiers+before+using+them |
70 | 8 | Andreas Steffen | |
71 | 1 | Andreas Steffen | * "DCL35-C. Call functions with the correct number and type of arguments":https://www.securecoding.cert.org/confluence/display/seccode/DCL35-C.+Call+functions+with+the+correct+number+and+type+of+arguments |
72 | 1 | Andreas Steffen | |
73 | 1 | Andreas Steffen | * "DCL36-C. Do not declare an identifier with conflicting linkage classifications":https://www.securecoding.cert.org/confluence/display/seccode/DCL36-C.+Do+not+declare+an+identifier+with+conflicting+linkage+classifications |
74 | 1 | Andreas Steffen | |
75 | 12 | Andreas Steffen | * "DCL38-C. Use the correct syntax when declaring flexible array members":https://www.securecoding.cert.org/confluence/display/seccode/DCL38-C.+Use+the+correct+syntax+when+declaring+flexible+array+members |
76 | 11 | Andreas Steffen | |
77 | 12 | Andreas Steffen | * "DCL40-C. Incompatible declarations of the same function or object":https://www.securecoding.cert.org/confluence/display/seccode/DCL40-C.+Incompatible+declarations+of+the+same+function+or+object |
78 | 12 | Andreas Steffen | |
79 | 13 | Andreas Steffen | _Partial Adherence_ |
80 | 12 | Andreas Steffen | |
81 | 8 | Andreas Steffen | * "DCL06-C. Use meaningful symbolic constants to represent literal values":https://www.securecoding.cert.org/confluence/display/seccode/DCL06-C.+Use+meaningful+symbolic+constants+to+represent+literal+values |
82 | 8 | Andreas Steffen | |
83 | 8 | Andreas Steffen | * "DCL19-C. Minimize the scope of variables and functions":https://www.securecoding.cert.org/confluence/display/seccode/DCL19-C.+Minimize+the+scope+of+variables+and+functions |
84 | 8 | Andreas Steffen | |
85 | 8 | Andreas Steffen | * "DCL20-C. Always specify void even if a function accepts no arguments":https://www.securecoding.cert.org/confluence/display/seccode/DCL20-C.+Always+specify+void+even+if+a+function+accepts+no+arguments |
86 | 8 | Andreas Steffen | |
87 | 13 | Andreas Steffen | _Check Adherence_ |
88 | 8 | Andreas Steffen | |
89 | 8 | Andreas Steffen | * "DCL08-C. Properly encode relationships in constant definitions":https://www.securecoding.cert.org/confluence/display/seccode/DCL08-C.+Properly+encode+relationships+in+constant+definitions |
90 | 8 | Andreas Steffen | |
91 | 8 | Andreas Steffen | * "DCL09-C. Declare functions that return errno with a return type of errno_t":https://www.securecoding.cert.org/confluence/display/seccode/DCL09-C.+Declare+functions+that+return+errno+with+a+return+type+of+errno_t |
92 | 8 | Andreas Steffen | |
93 | 8 | Andreas Steffen | * "DCL10-C. Maintain the contract between the writer and caller of variadic functions":https://www.securecoding.cert.org/confluence/display/seccode/DCL10-C.+Maintain+the+contract+between+the+writer+and+caller+of+variadic+functions |
94 | 8 | Andreas Steffen | |
95 | 8 | Andreas Steffen | * "DCL11-C. Understand the type issues associated with variadic functions":https://www.securecoding.cert.org/confluence/display/seccode/DCL11-C.+Understand+the+type+issues+associated+with+variadic+functions |
96 | 8 | Andreas Steffen | |
97 | 9 | Andreas Steffen | * "DCL16-C. Use 'L,' not 'l,' to indicate a long value":https://www.securecoding.cert.org/confluence/pages/viewpage.action?pageId=19759250 |
98 | 8 | Andreas Steffen | |
99 | 8 | Andreas Steffen | * "DCL17-C. Beware of miscompiled volatile-qualified variables":https://www.securecoding.cert.org/confluence/display/seccode/DCL17-C.+Beware+of+miscompiled+volatile-qualified+variables |
100 | 8 | Andreas Steffen | |
101 | 1 | Andreas Steffen | * "DCL21-C. Understand the storage of compound literals":https://www.securecoding.cert.org/confluence/display/seccode/DCL21-C.+Understand+the+storage+of+compound+literals |
102 | 1 | Andreas Steffen | |
103 | 1 | Andreas Steffen | * "DCL30-C. Declare objects with appropriate storage durations":https://www.securecoding.cert.org/confluence/display/seccode/DCL30-C.+Declare+objects+with+appropriate+storage+durations |
104 | 8 | Andreas Steffen | |
105 | 8 | Andreas Steffen | * "DCL34-C. Use volatile for data that cannot be cached":https://www.securecoding.cert.org/confluence/display/seccode/DCL34-C.+Use+volatile+for+data+that+cannot+be+cached |
106 | 8 | Andreas Steffen | |
107 | 8 | Andreas Steffen | * "DCL37-C. Do not declare or define a reserved identifier":https://www.securecoding.cert.org/confluence/display/seccode/DCL37-C.+Do+not+declare+or+define+a+reserved+identifier |
108 | 11 | Andreas Steffen | |
109 | 12 | Andreas Steffen | * "DCL39-C. Avoid information leak in structure padding":https://www.securecoding.cert.org/confluence/display/seccode/DCL39-C.+Avoid+information+leak+in+structure+padding |
110 | 12 | Andreas Steffen | |
111 | 13 | Andreas Steffen | _No Adherence_ |
112 | 6 | Andreas Steffen | |
113 | 6 | Andreas Steffen | * "DCL00-C. Const-qualify immutable objects":https://www.securecoding.cert.org/confluence/display/seccode/DCL00-C.+Const-qualify+immutable+objects |
114 | 6 | Andreas Steffen | |
115 | 6 | Andreas Steffen | * "DCL03-C. Use a static assertion to test the value of a constant expression":https://www.securecoding.cert.org/confluence/display/seccode/DCL03-C.+Use+a+static+assertion+to+test+the+value+of+a+constant+expression |
116 | 8 | Andreas Steffen | |
117 | 8 | Andreas Steffen | * "DCL04-C. Do not declare more than one variable per declaration":https://www.securecoding.cert.org/confluence/display/seccode/DCL04-C.+Do+not+declare+more+than+one+variable+per+declaration |
118 | 8 | Andreas Steffen | |
119 | 8 | Andreas Steffen | * "DCL13-C. Declare function parameters that are pointers to values not changed by the function as const ":https://www.securecoding.cert.org/confluence/display/seccode/DCL13-C.+Declare+function+parameters+that+are+pointers+to+values+not+changed+by+the+function+as+const |
120 | 8 | Andreas Steffen | |
121 | 8 | Andreas Steffen | * "DCL32-C. Guarantee that mutually visible identifiers are unique":https://www.securecoding.cert.org/confluence/display/seccode/DCL32-C.+Guarantee+that+mutually+visible+identifiers+are+unique |
122 | 6 | Andreas Steffen | |
123 | 1 | Andreas Steffen | h2. Expressions (EXP) |
124 | 1 | Andreas Steffen | |
125 | 14 | Andreas Steffen | _Full Adherence_ |
126 | 14 | Andreas Steffen | |
127 | 14 | Andreas Steffen | * "EXP00-C. Use parentheses for precedence of operation":https://www.securecoding.cert.org/confluence/display/seccode/EXP00-C.+Use+parentheses+for+precedence+of+operation |
128 | 14 | Andreas Steffen | |
129 | 14 | Andreas Steffen | * "EXP01-C. Do not take the size of a pointer to determine the size of the pointed-to type":https://www.securecoding.cert.org/confluence/display/seccode/EXP01-C.+Do+not+take+the+size+of+a+pointer+to+determine+the+size+of+the+pointed-to+type |
130 | 14 | Andreas Steffen | |
131 | 15 | Andreas Steffen | * "EXP02-C. Be aware of the short-circuit behavior of the logical AND and OR operators":https://www.securecoding.cert.org/confluence/display/seccode/EXP02-C.+Be+aware+of+the+short-circuit+behavior+of+the+logical+AND+and+OR+operators |
132 | 15 | Andreas Steffen | |
133 | 15 | Andreas Steffen | * "EXP03-C. Do not assume the size of a structure is the sum of the sizes of its members":https://www.securecoding.cert.org/confluence/display/seccode/EXP03-C.+Do+not+assume+the+size+of+a+structure+is+the+sum+of+the+sizes+of+its+members |
134 | 15 | Andreas Steffen | |
135 | 15 | Andreas Steffen | * "EXP04-C. Do not perform byte-by-byte comparisons involving a structure":https://www.securecoding.cert.org/confluence/display/seccode/EXP04-C.+Do+not+perform+byte-by-byte+comparisons+involving+a+structure |
136 | 15 | Andreas Steffen | |
137 | 15 | Andreas Steffen | * "EXP05-C. Do not cast away a const qualification":https://www.securecoding.cert.org/confluence/display/seccode/EXP04-C.+Do+not+perform+byte-by-byte+comparisons+involving+a+structure |
138 | 15 | Andreas Steffen | |
139 | 15 | Andreas Steffen | * "EXP06-C. Operands to the sizeof operator should not contain side effects":https://www.securecoding.cert.org/confluence/display/seccode/EXP06-C.+Operands+to+the+sizeof+operator+should+not+contain+side+effects |
140 | 15 | Andreas Steffen | |
141 | 15 | Andreas Steffen | * "EXP07-C. Do not diminish the benefits of constants by assuming their values in expressions":https://www.securecoding.cert.org/confluence/display/seccode/EXP07-C.+Do+not+diminish+the+benefits+of+constants+by+assuming+their+values+in+expressions |
142 | 15 | Andreas Steffen | |
143 | 16 | Andreas Steffen | * "EXP08-C. Ensure pointer arithmetic is used correctly":https://www.securecoding.cert.org/confluence/display/seccode/EXP08-C.+Ensure+pointer+arithmetic+is+used+correctly |
144 | 16 | Andreas Steffen | |
145 | 16 | Andreas Steffen | * "EXP09-C. Use sizeof to determine the size of a type or variable":https://www.securecoding.cert.org/confluence/display/seccode/EXP09-C.+Use+sizeof+to+determine+the+size+of+a+type+or+variable |
146 | 16 | Andreas Steffen | |
147 | 16 | Andreas Steffen | * "EXP10-C. Do not depend on the order of evaluation of subexpressions or the order in which side effects take place":https://www.securecoding.cert.org/confluence/display/seccode/EXP10-C.+Do+not+depend+on+the+order+of+evaluation+of+subexpressions+or+the+order+in+which+side+effects+take+place |
148 | 16 | Andreas Steffen | |
149 | 16 | Andreas Steffen | * "EXP12-C. Do not ignore values returned by functions":https://www.securecoding.cert.org/confluence/display/seccode/EXP12-C.+Do+not+ignore+values+returned+by+functions |
150 | 16 | Andreas Steffen | |
151 | 16 | Andreas Steffen | * "EXP13-C. Treat relational and equality operators as if they were nonassociative":https://www.securecoding.cert.org/confluence/display/seccode/EXP13-C.+Treat+relational+and+equality+operators+as+if+they+were+nonassociative |
152 | 16 | Andreas Steffen | |
153 | 17 | Andreas Steffen | * "EXP14-C. Beware of integer promotion when performing bitwise operations on integer types smaller than int":https://www.securecoding.cert.org/confluence/display/seccode/EXP14-C.+Beware+of+integer+promotion+when+performing+bitwise+operations+on+integer+types+smaller+than+int |
154 | 17 | Andreas Steffen | |
155 | 17 | Andreas Steffen | * "EXP15-C. Do not place a semicolon on the same line as an if, for, or while statement":https://www.securecoding.cert.org/confluence/display/seccode/EXP15-C.+Do+not+place+a+semicolon+on+the+same+line+as+an+if%2C+for%2C+or+while+statement |
156 | 17 | Andreas Steffen | |
157 | 17 | Andreas Steffen | * "EXP16-C. Do not compare function pointers to constant values":https://www.securecoding.cert.org/confluence/display/seccode/EXP16-C.+Do+not+compare+function+pointers+to+constant+values" |
158 | 17 | Andreas Steffen | |
159 | 17 | Andreas Steffen | * "EXP18-C. Do not perform assignments in selection statements":https://www.securecoding.cert.org/confluence/display/seccode/EXP18-C.+Do+not+perform+assignments+in+selection+statements |
160 | 17 | Andreas Steffen | |
161 | 17 | Andreas Steffen | * "EXP19-C. Use braces for the body of an if, for, or while statement":https://www.securecoding.cert.org/confluence/display/seccode/EXP19-C.+Use+braces+for+the+body+of+an+if%2C+for%2C+or+while+statement |
162 | 17 | Andreas Steffen | |
163 | 17 | Andreas Steffen | * "EXP30-C. Do not depend on order of evaluation between sequence points":https://www.securecoding.cert.org/confluence/display/seccode/EXP30-C.+Do+not+depend+on+order+of+evaluation+between+sequence+points |
164 | 17 | Andreas Steffen | |
165 | 17 | Andreas Steffen | * "EXP31-C. Avoid side effects in assertions":https://www.securecoding.cert.org/confluence/display/seccode/EXP31-C.+Avoid+side+effects+in+assertions |
166 | 17 | Andreas Steffen | |
167 | 17 | Andreas Steffen | * "EXP33-C. Do not reference uninitialized memory":https://www.securecoding.cert.org/confluence/display/seccode/EXP33-C.+Do+not+reference+uninitialized+memory |
168 | 17 | Andreas Steffen | |
169 | 17 | Andreas Steffen | * "EXP34-C. Do not dereference null pointers":https://www.securecoding.cert.org/confluence/display/seccode/EXP34-C.+Do+not+dereference+null+pointers |
170 | 17 | Andreas Steffen | |
171 | 17 | Andreas Steffen | * "EXP35-C. Do not modify objects with temporary lifetime":https://www.securecoding.cert.org/confluence/display/seccode/EXP35-C.+Do+not+modify+objects+with+temporary+lifetime |
172 | 17 | Andreas Steffen | |
173 | 17 | Andreas Steffen | * "EXP37-C. Call functions with the correct number and type of arguments":https://www.securecoding.cert.org/confluence/display/seccode/EXP37-C.+Call+functions+with+the+correct+number+and+type+of+arguments |
174 | 17 | Andreas Steffen | |
175 | 17 | Andreas Steffen | * "EXP38-C. Do not call offsetof() on bit-field members or invalid types":https://www.securecoding.cert.org/confluence/display/seccode/EXP38-C.+Do+not+call+offsetof%28%29+on+bit-field+members+or+invalid+types |
176 | 17 | Andreas Steffen | |
177 | 17 | Andreas Steffen | * "EXP40-C. Do not modify constant values":https://www.securecoding.cert.org/confluence/display/seccode/EXP40-C.+Do+not+modify+constant+values |
178 | 17 | Andreas Steffen | |
179 | 14 | Andreas Steffen | _Partial Adherence_ |
180 | 14 | Andreas Steffen | |
181 | 17 | Andreas Steffen | * "EXP20-C. Perform explicit tests to determine success, true and false, and equality":https://www.securecoding.cert.org/confluence/display/seccode/EXP20-C.+Perform+explicit+tests+to+determine+success%2C+true+and+false%2C+and+equality |
182 | 14 | Andreas Steffen | |
183 | 14 | Andreas Steffen | _Check Adherence_ |
184 | 14 | Andreas Steffen | |
185 | 16 | Andreas Steffen | * "EXP11-C. Do not make assumptions regarding the layout of structures with bit-fields":https://www.securecoding.cert.org/confluence/display/seccode/EXP11-C.+Do+not+make+assumptions+regarding+the+layout+of+structures+with+bit-fields |
186 | 14 | Andreas Steffen | |
187 | 17 | Andreas Steffen | * "EXP17-C. Do not perform bitwise operations in conditional expressions":https://www.securecoding.cert.org/confluence/display/seccode/EXP17-C.+Do+not+perform+bitwise+operations+in+conditional+expressions |
188 | 17 | Andreas Steffen | |
189 | 17 | Andreas Steffen | * "EXP32-C. Do not access a volatile object through a non-volatile reference":https://www.securecoding.cert.org/confluence/display/seccode/EXP32-C.+Do+not+access+a+volatile+object+through+a+non-volatile+reference |
190 | 17 | Andreas Steffen | |
191 | 17 | Andreas Steffen | * "EXP36-C. Do not convert pointers into more strictly aligned pointer types":https://www.securecoding.cert.org/confluence/display/seccode/EXP36-C.+Do+not+convert+pointers+into+more+strictly+aligned+pointer+types |
192 | 17 | Andreas Steffen | |
193 | 17 | Andreas Steffen | * "EXP39-C. Do not access a variable through a pointer of an incompatible type":https://www.securecoding.cert.org/confluence/display/seccode/EXP39-C.+Do+not+access+a+variable+through+a+pointer+of+an+incompatible+type |
194 | 17 | Andreas Steffen | |
195 | 17 | Andreas Steffen | * "EXP41-C. Do not add or subtract a scaled integer to a pointer":https://www.securecoding.cert.org/confluence/display/seccode/EXP41-C.+Do+not+add+or+subtract+a+scaled+integer+to+a+pointer |
196 | 17 | Andreas Steffen | |
197 | 14 | Andreas Steffen | _No Adherence_ |
198 | 17 | Andreas Steffen | |
199 | 17 | Andreas Steffen | * "EXP21-C. Place constants on the left of equality comparisons":https://www.securecoding.cert.org/confluence/display/seccode/EXP21-C.+Place+constants+on+the+left+of+equality+comparisons |
200 | 14 | Andreas Steffen | |
201 | 1 | Andreas Steffen | h2. Integers (INT) |
202 | 1 | Andreas Steffen | |
203 | 19 | Andreas Steffen | _Full Adherence_ |
204 | 19 | Andreas Steffen | |
205 | 19 | Andreas Steffen | * "INT00-C. Understand the data model used by your implementation(s)":https://www.securecoding.cert.org/confluence/pages/viewpage.action?pageId=4374 |
206 | 19 | Andreas Steffen | |
207 | 19 | Andreas Steffen | * "INT01-C. Use rsize_t or size_t for all integer values representing the size of an object":https://www.securecoding.cert.org/confluence/display/seccode/INT01-C.+Use+rsize_t+or+size_t+for+all+integer+values+representing+the+size+of+an+object |
208 | 19 | Andreas Steffen | |
209 | 19 | Andreas Steffen | * "INT02-C. Understand integer conversion rules":https://www.securecoding.cert.org/confluence/display/seccode/INT02-C.+Understand+integer+conversion+rules |
210 | 19 | Andreas Steffen | |
211 | 19 | Andreas Steffen | * "INT04-C. Enforce limits on integer values originating from untrusted sources":https://www.securecoding.cert.org/confluence/display/seccode/INT04-C.+Enforce+limits+on+integer+values+originating+from+untrusted+sources |
212 | 19 | Andreas Steffen | |
213 | 20 | Andreas Steffen | * "INT05-C. Do not use input functions to convert character data if they cannot handle all possible inputs":https://www.securecoding.cert.org/confluence/display/seccode/INT05-C.+Do+not+use+input+functions+to+convert+character+data+if+they+cannot+handle+all+possible+inputs |
214 | 20 | Andreas Steffen | |
215 | 20 | Andreas Steffen | * "INT09-C. Ensure enumeration constants map to unique values":https://www.securecoding.cert.org/confluence/display/seccode/INT09-C.+Ensure+enumeration+constants+map+to+unique+values |
216 | 20 | Andreas Steffen | |
217 | 20 | Andreas Steffen | * "INT10-C. Do not assume a positive remainder when using the % operator":https://www.securecoding.cert.org/confluence/pages/viewpage.action?pageId=6422581 |
218 | 20 | Andreas Steffen | |
219 | 20 | Andreas Steffen | * "INT11-C. Converting a pointer to integer or integer to pointer":https://www.securecoding.cert.org/confluence/display/seccode/INT11-C.+Converting+a+pointer+to+integer+or+integer+to+pointer |
220 | 20 | Andreas Steffen | |
221 | 20 | Andreas Steffen | _Partial Adherence_ |
222 | 20 | Andreas Steffen | |
223 | 20 | Andreas Steffen | * "INT06-C. Use strtol() or a related function to convert a string token to an integer":https://www.securecoding.cert.org/confluence/display/seccode/INT06-C.+Use+strtol%28%29+or+a+related+function+to+convert+a+string+token+to+an+integer |
224 | 20 | Andreas Steffen | |
225 | 20 | Andreas Steffen | * "INT07-C. Use only explicitly signed or unsigned char type for numeric values":https://www.securecoding.cert.org/confluence/display/seccode/INT07-C.+Use+only+explicitly+signed+or+unsigned+char+type+for+numeric+values |
226 | 20 | Andreas Steffen | |
227 | 20 | Andreas Steffen | _Check Adherence_ |
228 | 20 | Andreas Steffen | |
229 | 20 | Andreas Steffen | * "INT08-C. Verify that all integer values are in range":https://www.securecoding.cert.org/confluence/display/seccode/INT08-C.+Verify+that+all+integer+values+are+in+range |
230 | 20 | Andreas Steffen | |
231 | 20 | Andreas Steffen | |
232 | 20 | Andreas Steffen | |
233 | 20 | Andreas Steffen | |
234 | 20 | Andreas Steffen | |
235 | 20 | Andreas Steffen | |
236 | 1 | Andreas Steffen | h2. Floating Point (FLP) |
237 | 1 | Andreas Steffen | |
238 | 1 | Andreas Steffen | h2. Arrays (ARR) |
239 | 1 | Andreas Steffen | |
240 | 1 | Andreas Steffen | h2. Characters and Strings (STR) |
241 | 1 | Andreas Steffen | |
242 | 1 | Andreas Steffen | h2. Memory Management (MEM) |
243 | 1 | Andreas Steffen | |
244 | 1 | Andreas Steffen | h2. Input Output (FIO) |
245 | 1 | Andreas Steffen | |
246 | 1 | Andreas Steffen | h2. Environment (ENV) |
247 | 1 | Andreas Steffen | |
248 | 1 | Andreas Steffen | h2. Signals (SIG) |
249 | 1 | Andreas Steffen | |
250 | 1 | Andreas Steffen | h2. Error Handling (ERR) |
251 | 1 | Andreas Steffen | |
252 | 1 | Andreas Steffen | h2. Application Programming Interfaces (API) |
253 | 1 | Andreas Steffen | |
254 | 1 | Andreas Steffen | h2. Concurrency (CON) |
255 | 1 | Andreas Steffen | |
256 | 1 | Andreas Steffen | h2. Miscellaneous (MSC) |
257 | 1 | Andreas Steffen | |
258 | 1 | Andreas Steffen | h2. POSIX (POS) |