diff --git a/change-notes/1.26/analysis-cpp.md b/change-notes/1.26/analysis-cpp.md index 414637850b4..867320915a9 100644 --- a/change-notes/1.26/analysis-cpp.md +++ b/change-notes/1.26/analysis-cpp.md @@ -18,5 +18,6 @@ The following changes in version 1.26 affect C/C++ analysis in all applications. ## Changes to libraries +* The models library now models more taint flows through `std::string`. * The `SimpleRangeAnalysis` library now supports multiplications of the form `e1 * e2` when `e1` and `e2` are unsigned. diff --git a/cpp/ql/src/semmle/code/cpp/models/implementations/StdString.qll b/cpp/ql/src/semmle/code/cpp/models/implementations/StdString.qll index 9ffef420a19..06ca6ad8fd7 100644 --- a/cpp/ql/src/semmle/code/cpp/models/implementations/StdString.qll +++ b/cpp/ql/src/semmle/code/cpp/models/implementations/StdString.qll @@ -1,5 +1,12 @@ import semmle.code.cpp.models.interfaces.Taint +/** + * The `std::basic_string` template class. + */ +class StdBasicString extends TemplateClass { + StdBasicString() { this.hasQualifiedName("std", "basic_string") } +} + /** * The standard function `std::string.c_str`. */ @@ -12,3 +19,51 @@ class StdStringCStr extends TaintFunction { output.isReturnValue() } } + +/** + * The `std::string` function `operator+`. + */ +class StdStringPlus extends TaintFunction { + StdStringPlus() { + this.hasQualifiedName("std", "operator+") and + this.getUnspecifiedType() = any(StdBasicString s).getAnInstantiation() + } + + override predicate hasTaintFlow(FunctionInput input, FunctionOutput output) { + // flow from parameters to return value + ( + input.isParameterDeref(0) or + input.isParameterDeref(1) + ) and + output.isReturnValue() + } +} + +/** + * The `std::string` functions `operator+=` and `append`. + */ +class StdStringAppend extends TaintFunction { + StdStringAppend() { + this.hasQualifiedName("std", "basic_string", "operator+=") or + this.hasQualifiedName("std", "basic_string", "append") + } + + /** + * Gets the index of a parameter to this function that is a string (or + * character). + */ + int getAStringParameter() { + getParameter(result).getType() instanceof PointerType or + getParameter(result).getType() instanceof ReferenceType or + getParameter(result).getType() = getDeclaringType().getTemplateArgument(0) // i.e. `std::basic_string::CharT` + } + + override predicate hasTaintFlow(FunctionInput input, FunctionOutput output) { + // flow from parameter to string itself (qualifier) and return value + input.isParameterDeref(getAStringParameter()) and + ( + output.isQualifierObject() or + output.isReturnValueDeref() + ) + } +} diff --git a/cpp/ql/test/library-tests/dataflow/taint-tests/localTaint.expected b/cpp/ql/test/library-tests/dataflow/taint-tests/localTaint.expected index ed26a2de21d..cbaa02ae640 100644 --- a/cpp/ql/test/library-tests/dataflow/taint-tests/localTaint.expected +++ b/cpp/ql/test/library-tests/dataflow/taint-tests/localTaint.expected @@ -308,205 +308,284 @@ | movableclass.cpp:65:13:65:18 | call to source | movableclass.cpp:65:13:65:20 | call to MyMovableClass | TAINT | | movableclass.cpp:65:13:65:20 | call to MyMovableClass | movableclass.cpp:65:8:65:9 | ref arg s3 | TAINT | | movableclass.cpp:65:13:65:20 | call to MyMovableClass | movableclass.cpp:65:11:65:11 | call to operator= | TAINT | -| stl.cpp:97:12:97:17 | call to source | stl.cpp:101:7:101:7 | a | | -| stl.cpp:98:16:98:20 | 123 | stl.cpp:98:16:98:21 | call to basic_string | TAINT | -| stl.cpp:98:16:98:21 | call to basic_string | stl.cpp:102:7:102:7 | b | | -| stl.cpp:98:16:98:21 | call to basic_string | stl.cpp:104:7:104:7 | b | | -| stl.cpp:99:16:99:21 | call to source | stl.cpp:99:16:99:24 | call to basic_string | TAINT | -| stl.cpp:99:16:99:24 | call to basic_string | stl.cpp:103:7:103:7 | c | | -| stl.cpp:99:16:99:24 | call to basic_string | stl.cpp:105:7:105:7 | c | | -| stl.cpp:104:7:104:7 | b | stl.cpp:104:9:104:13 | call to c_str | TAINT | -| stl.cpp:105:7:105:7 | c | stl.cpp:105:9:105:13 | call to c_str | TAINT | -| stl.cpp:110:20:110:22 | call to basic_stringstream | stl.cpp:113:2:113:4 | ss1 | | -| stl.cpp:110:20:110:22 | call to basic_stringstream | stl.cpp:119:7:119:9 | ss1 | | -| stl.cpp:110:20:110:22 | call to basic_stringstream | stl.cpp:124:7:124:9 | ss1 | | -| stl.cpp:110:25:110:27 | call to basic_stringstream | stl.cpp:114:2:114:4 | ss2 | | -| stl.cpp:110:25:110:27 | call to basic_stringstream | stl.cpp:120:7:120:9 | ss2 | | -| stl.cpp:110:25:110:27 | call to basic_stringstream | stl.cpp:125:7:125:9 | ss2 | | -| stl.cpp:110:30:110:32 | call to basic_stringstream | stl.cpp:115:2:115:4 | ss3 | | -| stl.cpp:110:30:110:32 | call to basic_stringstream | stl.cpp:121:7:121:9 | ss3 | | -| stl.cpp:110:30:110:32 | call to basic_stringstream | stl.cpp:126:7:126:9 | ss3 | | -| stl.cpp:110:35:110:37 | call to basic_stringstream | stl.cpp:116:2:116:4 | ss4 | | -| stl.cpp:110:35:110:37 | call to basic_stringstream | stl.cpp:122:7:122:9 | ss4 | | -| stl.cpp:110:35:110:37 | call to basic_stringstream | stl.cpp:127:7:127:9 | ss4 | | -| stl.cpp:110:40:110:42 | call to basic_stringstream | stl.cpp:117:2:117:4 | ss5 | | -| stl.cpp:110:40:110:42 | call to basic_stringstream | stl.cpp:123:7:123:9 | ss5 | | -| stl.cpp:110:40:110:42 | call to basic_stringstream | stl.cpp:128:7:128:9 | ss5 | | +| stl.cpp:109:12:109:17 | call to source | stl.cpp:113:7:113:7 | a | | +| stl.cpp:110:16:110:20 | 123 | stl.cpp:110:16:110:21 | call to basic_string | TAINT | +| stl.cpp:110:16:110:21 | call to basic_string | stl.cpp:114:7:114:7 | b | | +| stl.cpp:110:16:110:21 | call to basic_string | stl.cpp:116:7:116:7 | b | | | stl.cpp:111:16:111:21 | call to source | stl.cpp:111:16:111:24 | call to basic_string | TAINT | -| stl.cpp:111:16:111:24 | call to basic_string | stl.cpp:117:9:117:9 | t | | -| stl.cpp:113:2:113:4 | ref arg ss1 | stl.cpp:119:7:119:9 | ss1 | | -| stl.cpp:113:2:113:4 | ref arg ss1 | stl.cpp:124:7:124:9 | ss1 | | -| stl.cpp:114:2:114:4 | ref arg ss2 | stl.cpp:120:7:120:9 | ss2 | | -| stl.cpp:114:2:114:4 | ref arg ss2 | stl.cpp:125:7:125:9 | ss2 | | -| stl.cpp:115:2:115:4 | ref arg ss3 | stl.cpp:121:7:121:9 | ss3 | | -| stl.cpp:115:2:115:4 | ref arg ss3 | stl.cpp:126:7:126:9 | ss3 | | -| stl.cpp:116:2:116:4 | ref arg ss4 | stl.cpp:122:7:122:9 | ss4 | | -| stl.cpp:116:2:116:4 | ref arg ss4 | stl.cpp:127:7:127:9 | ss4 | | -| stl.cpp:117:2:117:4 | ref arg ss5 | stl.cpp:123:7:123:9 | ss5 | | -| stl.cpp:117:2:117:4 | ref arg ss5 | stl.cpp:128:7:128:9 | ss5 | | -| stl.cpp:131:32:131:37 | source | stl.cpp:136:9:136:14 | source | | -| stl.cpp:133:20:133:22 | call to basic_stringstream | stl.cpp:135:2:135:4 | ss1 | | -| stl.cpp:133:20:133:22 | call to basic_stringstream | stl.cpp:138:7:138:9 | ss1 | | -| stl.cpp:133:20:133:22 | call to basic_stringstream | stl.cpp:140:7:140:9 | ss1 | | -| stl.cpp:133:25:133:27 | call to basic_stringstream | stl.cpp:136:2:136:4 | ss2 | | -| stl.cpp:133:25:133:27 | call to basic_stringstream | stl.cpp:139:7:139:9 | ss2 | | -| stl.cpp:133:25:133:27 | call to basic_stringstream | stl.cpp:141:7:141:9 | ss2 | | -| stl.cpp:135:2:135:4 | ref arg ss1 | stl.cpp:138:7:138:9 | ss1 | | -| stl.cpp:135:2:135:4 | ref arg ss1 | stl.cpp:140:7:140:9 | ss1 | | -| stl.cpp:136:2:136:4 | ref arg ss2 | stl.cpp:139:7:139:9 | ss2 | | -| stl.cpp:136:2:136:4 | ref arg ss2 | stl.cpp:141:7:141:9 | ss2 | | -| stl.cpp:154:16:154:28 | call to basic_string | stl.cpp:155:7:155:11 | path1 | | -| stl.cpp:154:17:154:26 | call to user_input | stl.cpp:154:16:154:28 | call to basic_string | TAINT | -| stl.cpp:155:7:155:11 | path1 | stl.cpp:155:13:155:17 | call to c_str | TAINT | -| stl.cpp:158:10:158:19 | call to user_input | stl.cpp:158:10:158:21 | call to basic_string | TAINT | -| stl.cpp:158:10:158:21 | call to basic_string | stl.cpp:158:2:158:21 | ... = ... | | -| stl.cpp:158:10:158:21 | call to basic_string | stl.cpp:159:7:159:11 | path2 | | -| stl.cpp:159:7:159:11 | path2 | stl.cpp:159:13:159:17 | call to c_str | TAINT | -| stl.cpp:161:15:161:24 | call to user_input | stl.cpp:161:15:161:27 | call to basic_string | TAINT | -| stl.cpp:161:15:161:27 | call to basic_string | stl.cpp:162:7:162:11 | path3 | | -| stl.cpp:162:7:162:11 | path3 | stl.cpp:162:13:162:17 | call to c_str | TAINT | -| stl.cpp:167:19:167:24 | call to source | stl.cpp:170:17:170:18 | cs | | -| stl.cpp:167:19:167:24 | call to source | stl.cpp:172:7:172:8 | cs | | -| stl.cpp:170:17:170:18 | cs | stl.cpp:170:17:170:19 | call to basic_string | TAINT | -| stl.cpp:170:17:170:19 | call to basic_string | stl.cpp:173:7:173:8 | ss | | -| stl.cpp:178:19:178:24 | call to source | stl.cpp:181:17:181:18 | cs | | -| stl.cpp:181:17:181:18 | cs | stl.cpp:181:17:181:19 | call to basic_string | TAINT | -| stl.cpp:181:17:181:19 | call to basic_string | stl.cpp:184:7:184:8 | ss | | -| stl.cpp:181:17:181:19 | call to basic_string | stl.cpp:187:7:187:8 | ss | | -| stl.cpp:184:7:184:8 | ss | stl.cpp:184:10:184:14 | call to c_str | TAINT | -| stl.cpp:184:10:184:14 | call to c_str | stl.cpp:184:2:184:16 | ... = ... | | -| stl.cpp:184:10:184:14 | call to c_str | stl.cpp:186:7:186:8 | cs | | -| stl.cpp:193:18:193:24 | hello | stl.cpp:193:18:193:25 | call to basic_string | TAINT | -| stl.cpp:193:18:193:25 | call to basic_string | stl.cpp:198:8:198:9 | s1 | | -| stl.cpp:194:19:194:26 | call to basic_string | stl.cpp:199:8:199:9 | s2 | | -| stl.cpp:194:20:194:26 | hello | stl.cpp:194:19:194:26 | call to basic_string | TAINT | -| stl.cpp:196:8:196:14 | call to basic_string | stl.cpp:196:3:196:14 | ... = ... | | -| stl.cpp:196:8:196:14 | call to basic_string | stl.cpp:200:8:200:9 | s3 | | -| stl.cpp:196:8:196:14 | hello | stl.cpp:196:8:196:14 | call to basic_string | TAINT | -| stl.cpp:204:18:204:23 | call to source | stl.cpp:204:18:204:26 | call to basic_string | TAINT | -| stl.cpp:204:18:204:26 | call to basic_string | stl.cpp:209:8:209:9 | s1 | | -| stl.cpp:205:19:205:27 | call to basic_string | stl.cpp:210:8:210:9 | s2 | | -| stl.cpp:205:20:205:25 | call to source | stl.cpp:205:19:205:27 | call to basic_string | TAINT | -| stl.cpp:207:8:207:13 | call to source | stl.cpp:207:8:207:15 | call to basic_string | TAINT | -| stl.cpp:207:8:207:15 | call to basic_string | stl.cpp:207:3:207:15 | ... = ... | | -| stl.cpp:207:8:207:15 | call to basic_string | stl.cpp:211:8:211:9 | s3 | | -| stl.cpp:215:15:215:16 | call to basic_string | stl.cpp:216:20:216:21 | s1 | | -| stl.cpp:215:15:215:16 | call to basic_string | stl.cpp:218:8:218:9 | s1 | | -| stl.cpp:215:15:215:16 | call to basic_string | stl.cpp:220:8:220:9 | s1 | | -| stl.cpp:216:20:216:21 | s1 | stl.cpp:221:8:221:9 | s2 | | -| stl.cpp:218:8:218:9 | s1 | stl.cpp:218:3:218:9 | ... = ... | | -| stl.cpp:218:8:218:9 | s1 | stl.cpp:222:8:222:9 | s3 | | -| stl.cpp:226:19:226:40 | call to basic_string | stl.cpp:230:8:230:9 | s1 | | -| stl.cpp:226:32:226:37 | call to source | stl.cpp:226:19:226:40 | call to basic_string | TAINT | -| stl.cpp:228:8:228:28 | call to basic_string | stl.cpp:228:3:228:28 | ... = ... | | -| stl.cpp:228:8:228:28 | call to basic_string | stl.cpp:231:8:231:9 | s2 | | -| stl.cpp:228:20:228:25 | call to source | stl.cpp:228:8:228:28 | call to basic_string | TAINT | -| stl.cpp:238:16:238:21 | call to source | stl.cpp:238:16:238:24 | call to basic_string | TAINT | -| stl.cpp:238:16:238:24 | call to basic_string | stl.cpp:239:15:239:15 | s | | -| stl.cpp:238:16:238:24 | call to basic_string | stl.cpp:243:33:243:33 | s | | -| stl.cpp:238:16:238:24 | call to basic_string | stl.cpp:243:50:243:50 | s | | -| stl.cpp:238:16:238:24 | call to basic_string | stl.cpp:247:16:247:16 | s | | -| stl.cpp:239:15:239:15 | call to begin | stl.cpp:239:15:239:15 | (__begin) | | -| stl.cpp:239:15:239:15 | call to begin | stl.cpp:239:15:239:15 | (__begin) | | -| stl.cpp:239:15:239:15 | call to begin | stl.cpp:239:15:239:15 | (__begin) | | -| stl.cpp:239:15:239:15 | call to end | stl.cpp:239:15:239:15 | (__end) | | -| stl.cpp:239:15:239:15 | call to operator* | stl.cpp:240:8:240:8 | c | | -| stl.cpp:239:15:239:15 | ref arg (__begin) | stl.cpp:239:15:239:15 | (__begin) | | -| stl.cpp:239:15:239:15 | ref arg (__begin) | stl.cpp:239:15:239:15 | (__begin) | | -| stl.cpp:239:15:239:15 | ref arg (__begin) | stl.cpp:239:15:239:15 | (__begin) | | -| stl.cpp:239:15:239:15 | ref arg (__range) | stl.cpp:239:15:239:15 | (__range) | | -| stl.cpp:239:15:239:15 | s | stl.cpp:239:15:239:15 | (__range) | | -| stl.cpp:239:15:239:15 | s | stl.cpp:239:15:239:15 | (__range) | | -| stl.cpp:239:15:239:15 | s | stl.cpp:239:15:239:15 | call to operator* | TAINT | -| stl.cpp:243:33:243:33 | ref arg s | stl.cpp:243:50:243:50 | s | | -| stl.cpp:243:33:243:33 | ref arg s | stl.cpp:247:16:247:16 | s | | -| stl.cpp:243:35:243:39 | call to begin | stl.cpp:243:44:243:45 | it | | -| stl.cpp:243:35:243:39 | call to begin | stl.cpp:243:61:243:62 | it | | -| stl.cpp:243:35:243:39 | call to begin | stl.cpp:244:9:244:10 | it | | -| stl.cpp:243:50:243:50 | ref arg s | stl.cpp:243:50:243:50 | s | | -| stl.cpp:243:50:243:50 | ref arg s | stl.cpp:247:16:247:16 | s | | -| stl.cpp:243:61:243:62 | ref arg it | stl.cpp:243:44:243:45 | it | | -| stl.cpp:243:61:243:62 | ref arg it | stl.cpp:243:61:243:62 | it | | -| stl.cpp:243:61:243:62 | ref arg it | stl.cpp:244:9:244:10 | it | | -| stl.cpp:247:16:247:16 | call to begin | stl.cpp:247:16:247:16 | (__begin) | | -| stl.cpp:247:16:247:16 | call to begin | stl.cpp:247:16:247:16 | (__begin) | | -| stl.cpp:247:16:247:16 | call to begin | stl.cpp:247:16:247:16 | (__begin) | | -| stl.cpp:247:16:247:16 | call to end | stl.cpp:247:16:247:16 | (__end) | | -| stl.cpp:247:16:247:16 | call to operator* | stl.cpp:248:8:248:8 | c | | -| stl.cpp:247:16:247:16 | ref arg (__begin) | stl.cpp:247:16:247:16 | (__begin) | | -| stl.cpp:247:16:247:16 | ref arg (__begin) | stl.cpp:247:16:247:16 | (__begin) | | -| stl.cpp:247:16:247:16 | ref arg (__begin) | stl.cpp:247:16:247:16 | (__begin) | | -| stl.cpp:247:16:247:16 | ref arg (__range) | stl.cpp:247:16:247:16 | (__range) | | -| stl.cpp:247:16:247:16 | s | stl.cpp:247:16:247:16 | (__range) | | -| stl.cpp:247:16:247:16 | s | stl.cpp:247:16:247:16 | (__range) | | -| stl.cpp:247:16:247:16 | s | stl.cpp:247:16:247:16 | call to operator* | TAINT | -| stl.cpp:251:28:251:33 | call to source | stl.cpp:251:28:251:36 | call to basic_string | TAINT | -| stl.cpp:251:28:251:36 | call to basic_string | stl.cpp:252:22:252:28 | const_s | | -| stl.cpp:252:22:252:22 | call to begin | stl.cpp:252:22:252:22 | (__begin) | | -| stl.cpp:252:22:252:22 | call to begin | stl.cpp:252:22:252:22 | (__begin) | | -| stl.cpp:252:22:252:22 | call to begin | stl.cpp:252:22:252:22 | (__begin) | | -| stl.cpp:252:22:252:22 | call to end | stl.cpp:252:22:252:22 | (__end) | | -| stl.cpp:252:22:252:22 | call to operator* | stl.cpp:253:8:253:8 | c | | -| stl.cpp:252:22:252:22 | ref arg (__begin) | stl.cpp:252:22:252:22 | (__begin) | | -| stl.cpp:252:22:252:22 | ref arg (__begin) | stl.cpp:252:22:252:22 | (__begin) | | -| stl.cpp:252:22:252:22 | ref arg (__begin) | stl.cpp:252:22:252:22 | (__begin) | | -| stl.cpp:252:22:252:28 | const_s | stl.cpp:252:22:252:22 | (__range) | | -| stl.cpp:252:22:252:28 | const_s | stl.cpp:252:22:252:22 | (__range) | | -| stl.cpp:252:22:252:28 | const_s | stl.cpp:252:22:252:22 | call to operator* | TAINT | -| stl.cpp:288:43:288:49 | source1 | stl.cpp:292:21:292:27 | source1 | | -| stl.cpp:288:43:288:49 | source1 | stl.cpp:306:33:306:39 | source1 | | -| stl.cpp:292:21:292:27 | source1 | stl.cpp:292:21:292:28 | call to vector | TAINT | -| stl.cpp:292:21:292:28 | call to vector | stl.cpp:294:14:294:14 | v | | -| stl.cpp:292:21:292:28 | call to vector | stl.cpp:298:38:298:38 | v | | -| stl.cpp:292:21:292:28 | call to vector | stl.cpp:298:55:298:55 | v | | -| stl.cpp:292:21:292:28 | call to vector | stl.cpp:302:15:302:15 | v | | -| stl.cpp:294:14:294:14 | call to begin | stl.cpp:294:14:294:14 | (__begin) | | -| stl.cpp:294:14:294:14 | call to begin | stl.cpp:294:14:294:14 | (__begin) | | -| stl.cpp:294:14:294:14 | call to begin | stl.cpp:294:14:294:14 | (__begin) | | -| stl.cpp:294:14:294:14 | call to end | stl.cpp:294:14:294:14 | (__end) | | -| stl.cpp:294:14:294:14 | call to operator* | stl.cpp:295:8:295:8 | x | | -| stl.cpp:294:14:294:14 | ref arg (__begin) | stl.cpp:294:14:294:14 | (__begin) | | -| stl.cpp:294:14:294:14 | ref arg (__begin) | stl.cpp:294:14:294:14 | (__begin) | | -| stl.cpp:294:14:294:14 | ref arg (__begin) | stl.cpp:294:14:294:14 | (__begin) | | -| stl.cpp:294:14:294:14 | ref arg (__range) | stl.cpp:294:14:294:14 | (__range) | | -| stl.cpp:294:14:294:14 | v | stl.cpp:294:14:294:14 | (__range) | | -| stl.cpp:294:14:294:14 | v | stl.cpp:294:14:294:14 | (__range) | | -| stl.cpp:294:14:294:14 | v | stl.cpp:294:14:294:14 | call to operator* | TAINT | -| stl.cpp:298:38:298:38 | ref arg v | stl.cpp:298:55:298:55 | v | | -| stl.cpp:298:38:298:38 | ref arg v | stl.cpp:302:15:302:15 | v | | -| stl.cpp:298:40:298:44 | call to begin | stl.cpp:298:49:298:50 | it | | -| stl.cpp:298:40:298:44 | call to begin | stl.cpp:298:66:298:67 | it | | -| stl.cpp:298:40:298:44 | call to begin | stl.cpp:299:9:299:10 | it | | -| stl.cpp:298:55:298:55 | ref arg v | stl.cpp:298:55:298:55 | v | | -| stl.cpp:298:55:298:55 | ref arg v | stl.cpp:302:15:302:15 | v | | -| stl.cpp:298:66:298:67 | ref arg it | stl.cpp:298:49:298:50 | it | | -| stl.cpp:298:66:298:67 | ref arg it | stl.cpp:298:66:298:67 | it | | -| stl.cpp:298:66:298:67 | ref arg it | stl.cpp:299:9:299:10 | it | | -| stl.cpp:302:15:302:15 | call to begin | stl.cpp:302:15:302:15 | (__begin) | | -| stl.cpp:302:15:302:15 | call to begin | stl.cpp:302:15:302:15 | (__begin) | | -| stl.cpp:302:15:302:15 | call to begin | stl.cpp:302:15:302:15 | (__begin) | | -| stl.cpp:302:15:302:15 | call to end | stl.cpp:302:15:302:15 | (__end) | | -| stl.cpp:302:15:302:15 | call to operator* | stl.cpp:303:8:303:8 | x | | -| stl.cpp:302:15:302:15 | ref arg (__begin) | stl.cpp:302:15:302:15 | (__begin) | | -| stl.cpp:302:15:302:15 | ref arg (__begin) | stl.cpp:302:15:302:15 | (__begin) | | -| stl.cpp:302:15:302:15 | ref arg (__begin) | stl.cpp:302:15:302:15 | (__begin) | | -| stl.cpp:302:15:302:15 | ref arg (__range) | stl.cpp:302:15:302:15 | (__range) | | -| stl.cpp:302:15:302:15 | v | stl.cpp:302:15:302:15 | (__range) | | -| stl.cpp:302:15:302:15 | v | stl.cpp:302:15:302:15 | (__range) | | -| stl.cpp:302:15:302:15 | v | stl.cpp:302:15:302:15 | call to operator* | TAINT | -| stl.cpp:306:33:306:39 | source1 | stl.cpp:306:33:306:40 | call to vector | TAINT | -| stl.cpp:306:33:306:40 | call to vector | stl.cpp:307:21:307:27 | const_v | | -| stl.cpp:307:21:307:21 | call to begin | stl.cpp:307:21:307:21 | (__begin) | | -| stl.cpp:307:21:307:21 | call to begin | stl.cpp:307:21:307:21 | (__begin) | | -| stl.cpp:307:21:307:21 | call to begin | stl.cpp:307:21:307:21 | (__begin) | | -| stl.cpp:307:21:307:21 | call to end | stl.cpp:307:21:307:21 | (__end) | | -| stl.cpp:307:21:307:21 | call to operator* | stl.cpp:308:8:308:8 | x | | -| stl.cpp:307:21:307:21 | ref arg (__begin) | stl.cpp:307:21:307:21 | (__begin) | | -| stl.cpp:307:21:307:21 | ref arg (__begin) | stl.cpp:307:21:307:21 | (__begin) | | -| stl.cpp:307:21:307:21 | ref arg (__begin) | stl.cpp:307:21:307:21 | (__begin) | | -| stl.cpp:307:21:307:27 | const_v | stl.cpp:307:21:307:21 | (__range) | | -| stl.cpp:307:21:307:27 | const_v | stl.cpp:307:21:307:21 | (__range) | | -| stl.cpp:307:21:307:27 | const_v | stl.cpp:307:21:307:21 | call to operator* | TAINT | +| stl.cpp:111:16:111:24 | call to basic_string | stl.cpp:115:7:115:7 | c | | +| stl.cpp:111:16:111:24 | call to basic_string | stl.cpp:117:7:117:7 | c | | +| stl.cpp:116:7:116:7 | b | stl.cpp:116:9:116:13 | call to c_str | TAINT | +| stl.cpp:117:7:117:7 | c | stl.cpp:117:9:117:13 | call to c_str | TAINT | +| stl.cpp:122:20:122:22 | call to basic_stringstream | stl.cpp:125:2:125:4 | ss1 | | +| stl.cpp:122:20:122:22 | call to basic_stringstream | stl.cpp:131:7:131:9 | ss1 | | +| stl.cpp:122:20:122:22 | call to basic_stringstream | stl.cpp:136:7:136:9 | ss1 | | +| stl.cpp:122:25:122:27 | call to basic_stringstream | stl.cpp:126:2:126:4 | ss2 | | +| stl.cpp:122:25:122:27 | call to basic_stringstream | stl.cpp:132:7:132:9 | ss2 | | +| stl.cpp:122:25:122:27 | call to basic_stringstream | stl.cpp:137:7:137:9 | ss2 | | +| stl.cpp:122:30:122:32 | call to basic_stringstream | stl.cpp:127:2:127:4 | ss3 | | +| stl.cpp:122:30:122:32 | call to basic_stringstream | stl.cpp:133:7:133:9 | ss3 | | +| stl.cpp:122:30:122:32 | call to basic_stringstream | stl.cpp:138:7:138:9 | ss3 | | +| stl.cpp:122:35:122:37 | call to basic_stringstream | stl.cpp:128:2:128:4 | ss4 | | +| stl.cpp:122:35:122:37 | call to basic_stringstream | stl.cpp:134:7:134:9 | ss4 | | +| stl.cpp:122:35:122:37 | call to basic_stringstream | stl.cpp:139:7:139:9 | ss4 | | +| stl.cpp:122:40:122:42 | call to basic_stringstream | stl.cpp:129:2:129:4 | ss5 | | +| stl.cpp:122:40:122:42 | call to basic_stringstream | stl.cpp:135:7:135:9 | ss5 | | +| stl.cpp:122:40:122:42 | call to basic_stringstream | stl.cpp:140:7:140:9 | ss5 | | +| stl.cpp:123:16:123:21 | call to source | stl.cpp:123:16:123:24 | call to basic_string | TAINT | +| stl.cpp:123:16:123:24 | call to basic_string | stl.cpp:129:9:129:9 | t | | +| stl.cpp:125:2:125:4 | ref arg ss1 | stl.cpp:131:7:131:9 | ss1 | | +| stl.cpp:125:2:125:4 | ref arg ss1 | stl.cpp:136:7:136:9 | ss1 | | +| stl.cpp:126:2:126:4 | ref arg ss2 | stl.cpp:132:7:132:9 | ss2 | | +| stl.cpp:126:2:126:4 | ref arg ss2 | stl.cpp:137:7:137:9 | ss2 | | +| stl.cpp:127:2:127:4 | ref arg ss3 | stl.cpp:133:7:133:9 | ss3 | | +| stl.cpp:127:2:127:4 | ref arg ss3 | stl.cpp:138:7:138:9 | ss3 | | +| stl.cpp:128:2:128:4 | ref arg ss4 | stl.cpp:134:7:134:9 | ss4 | | +| stl.cpp:128:2:128:4 | ref arg ss4 | stl.cpp:139:7:139:9 | ss4 | | +| stl.cpp:129:2:129:4 | ref arg ss5 | stl.cpp:135:7:135:9 | ss5 | | +| stl.cpp:129:2:129:4 | ref arg ss5 | stl.cpp:140:7:140:9 | ss5 | | +| stl.cpp:143:32:143:37 | source | stl.cpp:148:9:148:14 | source | | +| stl.cpp:145:20:145:22 | call to basic_stringstream | stl.cpp:147:2:147:4 | ss1 | | +| stl.cpp:145:20:145:22 | call to basic_stringstream | stl.cpp:150:7:150:9 | ss1 | | +| stl.cpp:145:20:145:22 | call to basic_stringstream | stl.cpp:152:7:152:9 | ss1 | | +| stl.cpp:145:25:145:27 | call to basic_stringstream | stl.cpp:148:2:148:4 | ss2 | | +| stl.cpp:145:25:145:27 | call to basic_stringstream | stl.cpp:151:7:151:9 | ss2 | | +| stl.cpp:145:25:145:27 | call to basic_stringstream | stl.cpp:153:7:153:9 | ss2 | | +| stl.cpp:147:2:147:4 | ref arg ss1 | stl.cpp:150:7:150:9 | ss1 | | +| stl.cpp:147:2:147:4 | ref arg ss1 | stl.cpp:152:7:152:9 | ss1 | | +| stl.cpp:148:2:148:4 | ref arg ss2 | stl.cpp:151:7:151:9 | ss2 | | +| stl.cpp:148:2:148:4 | ref arg ss2 | stl.cpp:153:7:153:9 | ss2 | | +| stl.cpp:166:16:166:28 | call to basic_string | stl.cpp:167:7:167:11 | path1 | | +| stl.cpp:166:17:166:26 | call to user_input | stl.cpp:166:16:166:28 | call to basic_string | TAINT | +| stl.cpp:167:7:167:11 | path1 | stl.cpp:167:13:167:17 | call to c_str | TAINT | +| stl.cpp:170:10:170:19 | call to user_input | stl.cpp:170:10:170:21 | call to basic_string | TAINT | +| stl.cpp:170:10:170:21 | call to basic_string | stl.cpp:170:2:170:21 | ... = ... | | +| stl.cpp:170:10:170:21 | call to basic_string | stl.cpp:171:7:171:11 | path2 | | +| stl.cpp:171:7:171:11 | path2 | stl.cpp:171:13:171:17 | call to c_str | TAINT | +| stl.cpp:173:15:173:24 | call to user_input | stl.cpp:173:15:173:27 | call to basic_string | TAINT | +| stl.cpp:173:15:173:27 | call to basic_string | stl.cpp:174:7:174:11 | path3 | | +| stl.cpp:174:7:174:11 | path3 | stl.cpp:174:13:174:17 | call to c_str | TAINT | +| stl.cpp:179:19:179:24 | call to source | stl.cpp:182:17:182:18 | cs | | +| stl.cpp:179:19:179:24 | call to source | stl.cpp:184:7:184:8 | cs | | +| stl.cpp:182:17:182:18 | cs | stl.cpp:182:17:182:19 | call to basic_string | TAINT | +| stl.cpp:182:17:182:19 | call to basic_string | stl.cpp:185:7:185:8 | ss | | +| stl.cpp:190:19:190:24 | call to source | stl.cpp:193:17:193:18 | cs | | +| stl.cpp:193:17:193:18 | cs | stl.cpp:193:17:193:19 | call to basic_string | TAINT | +| stl.cpp:193:17:193:19 | call to basic_string | stl.cpp:196:7:196:8 | ss | | +| stl.cpp:193:17:193:19 | call to basic_string | stl.cpp:199:7:199:8 | ss | | +| stl.cpp:196:7:196:8 | ss | stl.cpp:196:10:196:14 | call to c_str | TAINT | +| stl.cpp:196:10:196:14 | call to c_str | stl.cpp:196:2:196:16 | ... = ... | | +| stl.cpp:196:10:196:14 | call to c_str | stl.cpp:198:7:198:8 | cs | | +| stl.cpp:205:18:205:24 | hello | stl.cpp:205:18:205:25 | call to basic_string | TAINT | +| stl.cpp:205:18:205:25 | call to basic_string | stl.cpp:210:8:210:9 | s1 | | +| stl.cpp:206:19:206:26 | call to basic_string | stl.cpp:211:8:211:9 | s2 | | +| stl.cpp:206:20:206:26 | hello | stl.cpp:206:19:206:26 | call to basic_string | TAINT | +| stl.cpp:208:8:208:14 | call to basic_string | stl.cpp:208:3:208:14 | ... = ... | | +| stl.cpp:208:8:208:14 | call to basic_string | stl.cpp:212:8:212:9 | s3 | | +| stl.cpp:208:8:208:14 | hello | stl.cpp:208:8:208:14 | call to basic_string | TAINT | +| stl.cpp:216:18:216:23 | call to source | stl.cpp:216:18:216:26 | call to basic_string | TAINT | +| stl.cpp:216:18:216:26 | call to basic_string | stl.cpp:221:8:221:9 | s1 | | +| stl.cpp:217:19:217:27 | call to basic_string | stl.cpp:222:8:222:9 | s2 | | +| stl.cpp:217:20:217:25 | call to source | stl.cpp:217:19:217:27 | call to basic_string | TAINT | +| stl.cpp:219:8:219:13 | call to source | stl.cpp:219:8:219:15 | call to basic_string | TAINT | +| stl.cpp:219:8:219:15 | call to basic_string | stl.cpp:219:3:219:15 | ... = ... | | +| stl.cpp:219:8:219:15 | call to basic_string | stl.cpp:223:8:223:9 | s3 | | +| stl.cpp:227:15:227:16 | call to basic_string | stl.cpp:228:20:228:21 | s1 | | +| stl.cpp:227:15:227:16 | call to basic_string | stl.cpp:230:8:230:9 | s1 | | +| stl.cpp:227:15:227:16 | call to basic_string | stl.cpp:232:8:232:9 | s1 | | +| stl.cpp:228:20:228:21 | s1 | stl.cpp:233:8:233:9 | s2 | | +| stl.cpp:230:8:230:9 | s1 | stl.cpp:230:3:230:9 | ... = ... | | +| stl.cpp:230:8:230:9 | s1 | stl.cpp:234:8:234:9 | s3 | | +| stl.cpp:238:19:238:40 | call to basic_string | stl.cpp:242:8:242:9 | s1 | | +| stl.cpp:238:32:238:37 | call to source | stl.cpp:238:19:238:40 | call to basic_string | TAINT | +| stl.cpp:240:8:240:28 | call to basic_string | stl.cpp:240:3:240:28 | ... = ... | | +| stl.cpp:240:8:240:28 | call to basic_string | stl.cpp:243:8:243:9 | s2 | | +| stl.cpp:240:20:240:25 | call to source | stl.cpp:240:8:240:28 | call to basic_string | TAINT | +| stl.cpp:250:16:250:21 | call to source | stl.cpp:250:16:250:24 | call to basic_string | TAINT | +| stl.cpp:250:16:250:24 | call to basic_string | stl.cpp:251:15:251:15 | s | | +| stl.cpp:250:16:250:24 | call to basic_string | stl.cpp:255:33:255:33 | s | | +| stl.cpp:250:16:250:24 | call to basic_string | stl.cpp:255:50:255:50 | s | | +| stl.cpp:250:16:250:24 | call to basic_string | stl.cpp:259:16:259:16 | s | | +| stl.cpp:251:15:251:15 | call to begin | stl.cpp:251:15:251:15 | (__begin) | | +| stl.cpp:251:15:251:15 | call to begin | stl.cpp:251:15:251:15 | (__begin) | | +| stl.cpp:251:15:251:15 | call to begin | stl.cpp:251:15:251:15 | (__begin) | | +| stl.cpp:251:15:251:15 | call to end | stl.cpp:251:15:251:15 | (__end) | | +| stl.cpp:251:15:251:15 | call to operator* | stl.cpp:252:8:252:8 | c | | +| stl.cpp:251:15:251:15 | ref arg (__begin) | stl.cpp:251:15:251:15 | (__begin) | | +| stl.cpp:251:15:251:15 | ref arg (__begin) | stl.cpp:251:15:251:15 | (__begin) | | +| stl.cpp:251:15:251:15 | ref arg (__begin) | stl.cpp:251:15:251:15 | (__begin) | | +| stl.cpp:251:15:251:15 | ref arg (__range) | stl.cpp:251:15:251:15 | (__range) | | +| stl.cpp:251:15:251:15 | s | stl.cpp:251:15:251:15 | (__range) | | +| stl.cpp:251:15:251:15 | s | stl.cpp:251:15:251:15 | (__range) | | +| stl.cpp:251:15:251:15 | s | stl.cpp:251:15:251:15 | call to operator* | TAINT | +| stl.cpp:255:33:255:33 | ref arg s | stl.cpp:255:50:255:50 | s | | +| stl.cpp:255:33:255:33 | ref arg s | stl.cpp:259:16:259:16 | s | | +| stl.cpp:255:35:255:39 | call to begin | stl.cpp:255:44:255:45 | it | | +| stl.cpp:255:35:255:39 | call to begin | stl.cpp:255:61:255:62 | it | | +| stl.cpp:255:35:255:39 | call to begin | stl.cpp:256:9:256:10 | it | | +| stl.cpp:255:50:255:50 | ref arg s | stl.cpp:255:50:255:50 | s | | +| stl.cpp:255:50:255:50 | ref arg s | stl.cpp:259:16:259:16 | s | | +| stl.cpp:255:61:255:62 | ref arg it | stl.cpp:255:44:255:45 | it | | +| stl.cpp:255:61:255:62 | ref arg it | stl.cpp:255:61:255:62 | it | | +| stl.cpp:255:61:255:62 | ref arg it | stl.cpp:256:9:256:10 | it | | +| stl.cpp:259:16:259:16 | call to begin | stl.cpp:259:16:259:16 | (__begin) | | +| stl.cpp:259:16:259:16 | call to begin | stl.cpp:259:16:259:16 | (__begin) | | +| stl.cpp:259:16:259:16 | call to begin | stl.cpp:259:16:259:16 | (__begin) | | +| stl.cpp:259:16:259:16 | call to end | stl.cpp:259:16:259:16 | (__end) | | +| stl.cpp:259:16:259:16 | call to operator* | stl.cpp:260:8:260:8 | c | | +| stl.cpp:259:16:259:16 | ref arg (__begin) | stl.cpp:259:16:259:16 | (__begin) | | +| stl.cpp:259:16:259:16 | ref arg (__begin) | stl.cpp:259:16:259:16 | (__begin) | | +| stl.cpp:259:16:259:16 | ref arg (__begin) | stl.cpp:259:16:259:16 | (__begin) | | +| stl.cpp:259:16:259:16 | ref arg (__range) | stl.cpp:259:16:259:16 | (__range) | | +| stl.cpp:259:16:259:16 | s | stl.cpp:259:16:259:16 | (__range) | | +| stl.cpp:259:16:259:16 | s | stl.cpp:259:16:259:16 | (__range) | | +| stl.cpp:259:16:259:16 | s | stl.cpp:259:16:259:16 | call to operator* | TAINT | +| stl.cpp:263:28:263:33 | call to source | stl.cpp:263:28:263:36 | call to basic_string | TAINT | +| stl.cpp:263:28:263:36 | call to basic_string | stl.cpp:264:22:264:28 | const_s | | +| stl.cpp:264:22:264:22 | call to begin | stl.cpp:264:22:264:22 | (__begin) | | +| stl.cpp:264:22:264:22 | call to begin | stl.cpp:264:22:264:22 | (__begin) | | +| stl.cpp:264:22:264:22 | call to begin | stl.cpp:264:22:264:22 | (__begin) | | +| stl.cpp:264:22:264:22 | call to end | stl.cpp:264:22:264:22 | (__end) | | +| stl.cpp:264:22:264:22 | call to operator* | stl.cpp:265:8:265:8 | c | | +| stl.cpp:264:22:264:22 | ref arg (__begin) | stl.cpp:264:22:264:22 | (__begin) | | +| stl.cpp:264:22:264:22 | ref arg (__begin) | stl.cpp:264:22:264:22 | (__begin) | | +| stl.cpp:264:22:264:22 | ref arg (__begin) | stl.cpp:264:22:264:22 | (__begin) | | +| stl.cpp:264:22:264:28 | const_s | stl.cpp:264:22:264:22 | (__range) | | +| stl.cpp:264:22:264:28 | const_s | stl.cpp:264:22:264:22 | (__range) | | +| stl.cpp:264:22:264:28 | const_s | stl.cpp:264:22:264:22 | call to operator* | TAINT | +| stl.cpp:300:43:300:49 | source1 | stl.cpp:304:21:304:27 | source1 | | +| stl.cpp:300:43:300:49 | source1 | stl.cpp:318:33:318:39 | source1 | | +| stl.cpp:304:21:304:27 | source1 | stl.cpp:304:21:304:28 | call to vector | TAINT | +| stl.cpp:304:21:304:28 | call to vector | stl.cpp:306:14:306:14 | v | | +| stl.cpp:304:21:304:28 | call to vector | stl.cpp:310:38:310:38 | v | | +| stl.cpp:304:21:304:28 | call to vector | stl.cpp:310:55:310:55 | v | | +| stl.cpp:304:21:304:28 | call to vector | stl.cpp:314:15:314:15 | v | | +| stl.cpp:306:14:306:14 | call to begin | stl.cpp:306:14:306:14 | (__begin) | | +| stl.cpp:306:14:306:14 | call to begin | stl.cpp:306:14:306:14 | (__begin) | | +| stl.cpp:306:14:306:14 | call to begin | stl.cpp:306:14:306:14 | (__begin) | | +| stl.cpp:306:14:306:14 | call to end | stl.cpp:306:14:306:14 | (__end) | | +| stl.cpp:306:14:306:14 | call to operator* | stl.cpp:307:8:307:8 | x | | +| stl.cpp:306:14:306:14 | ref arg (__begin) | stl.cpp:306:14:306:14 | (__begin) | | +| stl.cpp:306:14:306:14 | ref arg (__begin) | stl.cpp:306:14:306:14 | (__begin) | | +| stl.cpp:306:14:306:14 | ref arg (__begin) | stl.cpp:306:14:306:14 | (__begin) | | +| stl.cpp:306:14:306:14 | ref arg (__range) | stl.cpp:306:14:306:14 | (__range) | | +| stl.cpp:306:14:306:14 | v | stl.cpp:306:14:306:14 | (__range) | | +| stl.cpp:306:14:306:14 | v | stl.cpp:306:14:306:14 | (__range) | | +| stl.cpp:306:14:306:14 | v | stl.cpp:306:14:306:14 | call to operator* | TAINT | +| stl.cpp:310:38:310:38 | ref arg v | stl.cpp:310:55:310:55 | v | | +| stl.cpp:310:38:310:38 | ref arg v | stl.cpp:314:15:314:15 | v | | +| stl.cpp:310:40:310:44 | call to begin | stl.cpp:310:49:310:50 | it | | +| stl.cpp:310:40:310:44 | call to begin | stl.cpp:310:66:310:67 | it | | +| stl.cpp:310:40:310:44 | call to begin | stl.cpp:311:9:311:10 | it | | +| stl.cpp:310:55:310:55 | ref arg v | stl.cpp:310:55:310:55 | v | | +| stl.cpp:310:55:310:55 | ref arg v | stl.cpp:314:15:314:15 | v | | +| stl.cpp:310:66:310:67 | ref arg it | stl.cpp:310:49:310:50 | it | | +| stl.cpp:310:66:310:67 | ref arg it | stl.cpp:310:66:310:67 | it | | +| stl.cpp:310:66:310:67 | ref arg it | stl.cpp:311:9:311:10 | it | | +| stl.cpp:314:15:314:15 | call to begin | stl.cpp:314:15:314:15 | (__begin) | | +| stl.cpp:314:15:314:15 | call to begin | stl.cpp:314:15:314:15 | (__begin) | | +| stl.cpp:314:15:314:15 | call to begin | stl.cpp:314:15:314:15 | (__begin) | | +| stl.cpp:314:15:314:15 | call to end | stl.cpp:314:15:314:15 | (__end) | | +| stl.cpp:314:15:314:15 | call to operator* | stl.cpp:315:8:315:8 | x | | +| stl.cpp:314:15:314:15 | ref arg (__begin) | stl.cpp:314:15:314:15 | (__begin) | | +| stl.cpp:314:15:314:15 | ref arg (__begin) | stl.cpp:314:15:314:15 | (__begin) | | +| stl.cpp:314:15:314:15 | ref arg (__begin) | stl.cpp:314:15:314:15 | (__begin) | | +| stl.cpp:314:15:314:15 | ref arg (__range) | stl.cpp:314:15:314:15 | (__range) | | +| stl.cpp:314:15:314:15 | v | stl.cpp:314:15:314:15 | (__range) | | +| stl.cpp:314:15:314:15 | v | stl.cpp:314:15:314:15 | (__range) | | +| stl.cpp:314:15:314:15 | v | stl.cpp:314:15:314:15 | call to operator* | TAINT | +| stl.cpp:318:33:318:39 | source1 | stl.cpp:318:33:318:40 | call to vector | TAINT | +| stl.cpp:318:33:318:40 | call to vector | stl.cpp:319:21:319:27 | const_v | | +| stl.cpp:319:21:319:21 | call to begin | stl.cpp:319:21:319:21 | (__begin) | | +| stl.cpp:319:21:319:21 | call to begin | stl.cpp:319:21:319:21 | (__begin) | | +| stl.cpp:319:21:319:21 | call to begin | stl.cpp:319:21:319:21 | (__begin) | | +| stl.cpp:319:21:319:21 | call to end | stl.cpp:319:21:319:21 | (__end) | | +| stl.cpp:319:21:319:21 | call to operator* | stl.cpp:320:8:320:8 | x | | +| stl.cpp:319:21:319:21 | ref arg (__begin) | stl.cpp:319:21:319:21 | (__begin) | | +| stl.cpp:319:21:319:21 | ref arg (__begin) | stl.cpp:319:21:319:21 | (__begin) | | +| stl.cpp:319:21:319:21 | ref arg (__begin) | stl.cpp:319:21:319:21 | (__begin) | | +| stl.cpp:319:21:319:27 | const_v | stl.cpp:319:21:319:21 | (__range) | | +| stl.cpp:319:21:319:27 | const_v | stl.cpp:319:21:319:21 | (__range) | | +| stl.cpp:319:21:319:27 | const_v | stl.cpp:319:21:319:21 | call to operator* | TAINT | +| stl.cpp:331:18:331:24 | hello | stl.cpp:331:18:331:25 | call to basic_string | TAINT | +| stl.cpp:331:18:331:25 | call to basic_string | stl.cpp:334:8:334:9 | s1 | | +| stl.cpp:331:18:331:25 | call to basic_string | stl.cpp:334:13:334:14 | s1 | | +| stl.cpp:331:18:331:25 | call to basic_string | stl.cpp:335:8:335:9 | s1 | | +| stl.cpp:331:18:331:25 | call to basic_string | stl.cpp:336:13:336:14 | s1 | | +| stl.cpp:331:18:331:25 | call to basic_string | stl.cpp:339:8:339:9 | s1 | | +| stl.cpp:331:18:331:25 | call to basic_string | stl.cpp:340:8:340:9 | s1 | | +| stl.cpp:332:18:332:23 | call to source | stl.cpp:332:18:332:26 | call to basic_string | TAINT | +| stl.cpp:332:18:332:26 | call to basic_string | stl.cpp:335:13:335:14 | s2 | | +| stl.cpp:332:18:332:26 | call to basic_string | stl.cpp:336:8:336:9 | s2 | | +| stl.cpp:332:18:332:26 | call to basic_string | stl.cpp:337:8:337:9 | s2 | | +| stl.cpp:332:18:332:26 | call to basic_string | stl.cpp:337:13:337:14 | s2 | | +| stl.cpp:334:8:334:9 | s1 | stl.cpp:334:11:334:11 | call to operator+ | TAINT | +| stl.cpp:334:13:334:14 | s1 | stl.cpp:334:11:334:11 | call to operator+ | TAINT | +| stl.cpp:335:8:335:9 | s1 | stl.cpp:335:11:335:11 | call to operator+ | TAINT | +| stl.cpp:335:13:335:14 | s2 | stl.cpp:335:11:335:11 | call to operator+ | TAINT | +| stl.cpp:336:8:336:9 | s2 | stl.cpp:336:11:336:11 | call to operator+ | TAINT | +| stl.cpp:336:13:336:14 | s1 | stl.cpp:336:11:336:11 | call to operator+ | TAINT | +| stl.cpp:337:8:337:9 | s2 | stl.cpp:337:11:337:11 | call to operator+ | TAINT | +| stl.cpp:337:13:337:14 | s2 | stl.cpp:337:11:337:11 | call to operator+ | TAINT | +| stl.cpp:339:8:339:9 | s1 | stl.cpp:339:11:339:11 | call to operator+ | TAINT | +| stl.cpp:339:13:339:20 | world | stl.cpp:339:11:339:11 | call to operator+ | TAINT | +| stl.cpp:340:8:340:9 | s1 | stl.cpp:340:11:340:11 | call to operator+ | TAINT | +| stl.cpp:340:13:340:18 | call to source | stl.cpp:340:11:340:11 | call to operator+ | TAINT | +| stl.cpp:344:18:344:22 | abc | stl.cpp:344:18:344:23 | call to basic_string | TAINT | +| stl.cpp:344:18:344:23 | call to basic_string | stl.cpp:348:8:348:9 | s3 | | +| stl.cpp:344:18:344:23 | call to basic_string | stl.cpp:351:8:351:9 | s3 | | +| stl.cpp:344:18:344:23 | call to basic_string | stl.cpp:355:8:355:9 | s3 | | +| stl.cpp:344:18:344:23 | call to basic_string | stl.cpp:360:8:360:9 | s3 | | +| stl.cpp:344:18:344:23 | call to basic_string | stl.cpp:364:8:364:9 | s3 | | +| stl.cpp:345:18:345:23 | call to source | stl.cpp:345:18:345:26 | call to basic_string | TAINT | +| stl.cpp:345:18:345:26 | call to basic_string | stl.cpp:348:13:348:14 | s4 | | +| stl.cpp:345:18:345:26 | call to basic_string | stl.cpp:352:9:352:10 | s4 | | +| stl.cpp:345:18:345:26 | call to basic_string | stl.cpp:361:13:361:14 | s4 | | +| stl.cpp:348:8:348:9 | s3 | stl.cpp:348:11:348:11 | call to operator+ | TAINT | +| stl.cpp:348:11:348:11 | call to operator+ | stl.cpp:348:3:348:14 | ... = ... | | +| stl.cpp:348:11:348:11 | call to operator+ | stl.cpp:349:8:349:9 | s5 | | +| stl.cpp:348:13:348:14 | s4 | stl.cpp:348:11:348:11 | call to operator+ | TAINT | +| stl.cpp:351:8:351:9 | s3 | stl.cpp:351:3:351:9 | ... = ... | | +| stl.cpp:351:8:351:9 | s3 | stl.cpp:352:3:352:4 | s6 | | +| stl.cpp:351:8:351:9 | s3 | stl.cpp:353:8:353:9 | s6 | | +| stl.cpp:352:3:352:4 | ref arg s6 | stl.cpp:353:8:353:9 | s6 | | +| stl.cpp:352:9:352:10 | s4 | stl.cpp:352:3:352:4 | ref arg s6 | TAINT | +| stl.cpp:352:9:352:10 | s4 | stl.cpp:352:6:352:6 | call to operator+= | TAINT | +| stl.cpp:355:8:355:9 | s3 | stl.cpp:355:3:355:9 | ... = ... | | +| stl.cpp:355:8:355:9 | s3 | stl.cpp:356:3:356:4 | s7 | | +| stl.cpp:355:8:355:9 | s3 | stl.cpp:357:3:357:4 | s7 | | +| stl.cpp:355:8:355:9 | s3 | stl.cpp:358:8:358:9 | s7 | | +| stl.cpp:356:3:356:4 | ref arg s7 | stl.cpp:357:3:357:4 | s7 | | +| stl.cpp:356:3:356:4 | ref arg s7 | stl.cpp:358:8:358:9 | s7 | | +| stl.cpp:356:9:356:14 | call to source | stl.cpp:356:3:356:4 | ref arg s7 | TAINT | +| stl.cpp:356:9:356:14 | call to source | stl.cpp:356:6:356:6 | call to operator+= | TAINT | +| stl.cpp:357:3:357:4 | ref arg s7 | stl.cpp:358:8:358:9 | s7 | | +| stl.cpp:357:9:357:11 | | stl.cpp:357:3:357:4 | ref arg s7 | TAINT | +| stl.cpp:357:9:357:11 | | stl.cpp:357:6:357:6 | call to operator+= | TAINT | +| stl.cpp:360:8:360:9 | s3 | stl.cpp:360:3:360:9 | ... = ... | | +| stl.cpp:360:8:360:9 | s3 | stl.cpp:361:3:361:4 | s8 | | +| stl.cpp:360:8:360:9 | s3 | stl.cpp:362:8:362:9 | s8 | | +| stl.cpp:361:3:361:4 | ref arg s8 | stl.cpp:362:8:362:9 | s8 | | +| stl.cpp:361:13:361:14 | s4 | stl.cpp:361:3:361:4 | ref arg s8 | TAINT | +| stl.cpp:361:13:361:14 | s4 | stl.cpp:361:6:361:11 | call to append | TAINT | +| stl.cpp:364:8:364:9 | s3 | stl.cpp:364:3:364:9 | ... = ... | | +| stl.cpp:364:8:364:9 | s3 | stl.cpp:365:3:365:4 | s9 | | +| stl.cpp:364:8:364:9 | s3 | stl.cpp:366:3:366:4 | s9 | | +| stl.cpp:364:8:364:9 | s3 | stl.cpp:367:8:367:9 | s9 | | +| stl.cpp:365:3:365:4 | ref arg s9 | stl.cpp:366:3:366:4 | s9 | | +| stl.cpp:365:3:365:4 | ref arg s9 | stl.cpp:367:8:367:9 | s9 | | +| stl.cpp:365:13:365:18 | call to source | stl.cpp:365:3:365:4 | ref arg s9 | TAINT | +| stl.cpp:365:13:365:18 | call to source | stl.cpp:365:6:365:11 | call to append | TAINT | +| stl.cpp:366:3:366:4 | ref arg s9 | stl.cpp:367:8:367:9 | s9 | | +| stl.cpp:366:13:366:15 | | stl.cpp:366:3:366:4 | ref arg s9 | TAINT | +| stl.cpp:366:13:366:15 | | stl.cpp:366:6:366:11 | call to append | TAINT | +| stl.cpp:371:19:371:23 | abc | stl.cpp:371:19:371:24 | call to basic_string | TAINT | +| stl.cpp:371:19:371:24 | call to basic_string | stl.cpp:374:3:374:5 | s10 | | +| stl.cpp:371:19:371:24 | call to basic_string | stl.cpp:375:8:375:10 | s10 | | +| stl.cpp:372:12:372:26 | call to source | stl.cpp:374:17:374:17 | c | | +| stl.cpp:374:3:374:5 | ref arg s10 | stl.cpp:375:8:375:10 | s10 | | +| stl.cpp:374:17:374:17 | c | stl.cpp:374:3:374:5 | ref arg s10 | TAINT | +| stl.cpp:374:17:374:17 | c | stl.cpp:374:7:374:12 | call to append | TAINT | | structlikeclass.cpp:5:7:5:7 | Unknown literal | structlikeclass.cpp:5:7:5:7 | constructor init of field v | TAINT | | structlikeclass.cpp:5:7:5:7 | Unknown literal | structlikeclass.cpp:5:7:5:7 | constructor init of field v | TAINT | | structlikeclass.cpp:5:7:5:7 | this | structlikeclass.cpp:5:7:5:7 | constructor init of field v [pre-this] | | diff --git a/cpp/ql/test/library-tests/dataflow/taint-tests/stl.cpp b/cpp/ql/test/library-tests/dataflow/taint-tests/stl.cpp index 654628a4dd4..d0253b9b025 100644 --- a/cpp/ql/test/library-tests/dataflow/taint-tests/stl.cpp +++ b/cpp/ql/test/library-tests/dataflow/taint-tests/stl.cpp @@ -30,11 +30,14 @@ namespace std template class allocator { public: allocator() throw(); + typedef size_t size_type; }; template, class Allocator = allocator > class basic_string { public: + typedef typename Allocator::size_type size_type; + explicit basic_string(const Allocator& a = Allocator()); basic_string(const charT* s, const Allocator& a = Allocator()); @@ -49,8 +52,17 @@ namespace std const_iterator end() const; const_iterator cbegin() const; const_iterator cend() const; + + template basic_string& operator+=(const T& t); + basic_string& operator+=(const charT* s); + basic_string& append(const basic_string& str); + basic_string& append(const charT* s); + basic_string& append(size_type n, charT c); }; + template basic_string operator+(const basic_string& lhs, const basic_string& rhs); + template basic_string operator+(const basic_string& lhs, const charT* rhs); + typedef basic_string string; template > @@ -308,3 +320,58 @@ void test_range_based_for_loop_vector(int source1) { sink(x); // tainted [NOT DETECTED by IR] } } + +namespace ns_char +{ + char source(); +} + +void test_string_append() { + { + std::string s1("hello"); + std::string s2(source()); + + sink(s1 + s1); + sink(s1 + s2); // tainted + sink(s2 + s1); // tainted + sink(s2 + s2); // tainted + + sink(s1 + " world"); + sink(s1 + source()); // tainted + } + + { + std::string s3("abc"); + std::string s4(source()); + std::string s5, s6, s7, s8, s9; + + s5 = s3 + s4; + sink(s5); // tainted + + s6 = s3; + s6 += s4; + sink(s6); // tainted + + s7 = s3; + s7 += source(); + s7 += " "; + sink(s7); // tainted + + s8 = s3; + s8.append(s4); + sink(s8); // tainted + + s9 = s3; + s9.append(source()); + s9.append(" "); + sink(s9); // tainted + } + + { + std::string s10("abc"); + char c = ns_char::source(); + + s10.append(1, c); + sink(s10); // tainted + } +} diff --git a/cpp/ql/test/library-tests/dataflow/taint-tests/taint.expected b/cpp/ql/test/library-tests/dataflow/taint-tests/taint.expected index cd213ac2055..3c3ed47e351 100644 --- a/cpp/ql/test/library-tests/dataflow/taint-tests/taint.expected +++ b/cpp/ql/test/library-tests/dataflow/taint-tests/taint.expected @@ -32,27 +32,37 @@ | movableclass.cpp:55:8:55:9 | s2 | movableclass.cpp:52:23:52:28 | call to source | | movableclass.cpp:64:8:64:9 | s2 | movableclass.cpp:23:55:23:60 | call to source | | movableclass.cpp:65:11:65:11 | call to operator= | movableclass.cpp:65:13:65:18 | call to source | -| stl.cpp:101:7:101:7 | a | stl.cpp:97:12:97:17 | call to source | -| stl.cpp:103:7:103:7 | c | stl.cpp:99:16:99:21 | call to source | -| stl.cpp:105:9:105:13 | call to c_str | stl.cpp:99:16:99:21 | call to source | -| stl.cpp:155:13:155:17 | call to c_str | stl.cpp:147:10:147:15 | call to source | -| stl.cpp:159:13:159:17 | call to c_str | stl.cpp:147:10:147:15 | call to source | -| stl.cpp:162:13:162:17 | call to c_str | stl.cpp:147:10:147:15 | call to source | -| stl.cpp:172:7:172:8 | cs | stl.cpp:167:19:167:24 | call to source | -| stl.cpp:173:7:173:8 | ss | stl.cpp:167:19:167:24 | call to source | -| stl.cpp:186:7:186:8 | cs | stl.cpp:178:19:178:24 | call to source | -| stl.cpp:187:7:187:8 | ss | stl.cpp:178:19:178:24 | call to source | -| stl.cpp:209:8:209:9 | s1 | stl.cpp:204:18:204:23 | call to source | -| stl.cpp:210:8:210:9 | s2 | stl.cpp:205:20:205:25 | call to source | -| stl.cpp:211:8:211:9 | s3 | stl.cpp:207:8:207:13 | call to source | -| stl.cpp:230:8:230:9 | s1 | stl.cpp:226:32:226:37 | call to source | -| stl.cpp:231:8:231:9 | s2 | stl.cpp:228:20:228:25 | call to source | -| stl.cpp:240:8:240:8 | c | stl.cpp:238:16:238:21 | call to source | -| stl.cpp:248:8:248:8 | c | stl.cpp:238:16:238:21 | call to source | -| stl.cpp:253:8:253:8 | c | stl.cpp:251:28:251:33 | call to source | -| stl.cpp:295:8:295:8 | x | stl.cpp:288:43:288:49 | source1 | -| stl.cpp:303:8:303:8 | x | stl.cpp:288:43:288:49 | source1 | -| stl.cpp:308:8:308:8 | x | stl.cpp:288:43:288:49 | source1 | +| stl.cpp:113:7:113:7 | a | stl.cpp:109:12:109:17 | call to source | +| stl.cpp:115:7:115:7 | c | stl.cpp:111:16:111:21 | call to source | +| stl.cpp:117:9:117:13 | call to c_str | stl.cpp:111:16:111:21 | call to source | +| stl.cpp:167:13:167:17 | call to c_str | stl.cpp:159:10:159:15 | call to source | +| stl.cpp:171:13:171:17 | call to c_str | stl.cpp:159:10:159:15 | call to source | +| stl.cpp:174:13:174:17 | call to c_str | stl.cpp:159:10:159:15 | call to source | +| stl.cpp:184:7:184:8 | cs | stl.cpp:179:19:179:24 | call to source | +| stl.cpp:185:7:185:8 | ss | stl.cpp:179:19:179:24 | call to source | +| stl.cpp:198:7:198:8 | cs | stl.cpp:190:19:190:24 | call to source | +| stl.cpp:199:7:199:8 | ss | stl.cpp:190:19:190:24 | call to source | +| stl.cpp:221:8:221:9 | s1 | stl.cpp:216:18:216:23 | call to source | +| stl.cpp:222:8:222:9 | s2 | stl.cpp:217:20:217:25 | call to source | +| stl.cpp:223:8:223:9 | s3 | stl.cpp:219:8:219:13 | call to source | +| stl.cpp:242:8:242:9 | s1 | stl.cpp:238:32:238:37 | call to source | +| stl.cpp:243:8:243:9 | s2 | stl.cpp:240:20:240:25 | call to source | +| stl.cpp:252:8:252:8 | c | stl.cpp:250:16:250:21 | call to source | +| stl.cpp:260:8:260:8 | c | stl.cpp:250:16:250:21 | call to source | +| stl.cpp:265:8:265:8 | c | stl.cpp:263:28:263:33 | call to source | +| stl.cpp:307:8:307:8 | x | stl.cpp:300:43:300:49 | source1 | +| stl.cpp:315:8:315:8 | x | stl.cpp:300:43:300:49 | source1 | +| stl.cpp:320:8:320:8 | x | stl.cpp:300:43:300:49 | source1 | +| stl.cpp:335:11:335:11 | call to operator+ | stl.cpp:332:18:332:23 | call to source | +| stl.cpp:336:11:336:11 | call to operator+ | stl.cpp:332:18:332:23 | call to source | +| stl.cpp:337:11:337:11 | call to operator+ | stl.cpp:332:18:332:23 | call to source | +| stl.cpp:340:11:340:11 | call to operator+ | stl.cpp:340:13:340:18 | call to source | +| stl.cpp:349:8:349:9 | s5 | stl.cpp:345:18:345:23 | call to source | +| stl.cpp:353:8:353:9 | s6 | stl.cpp:345:18:345:23 | call to source | +| stl.cpp:358:8:358:9 | s7 | stl.cpp:356:9:356:14 | call to source | +| stl.cpp:362:8:362:9 | s8 | stl.cpp:345:18:345:23 | call to source | +| stl.cpp:367:8:367:9 | s9 | stl.cpp:365:13:365:18 | call to source | +| stl.cpp:375:8:375:10 | s10 | stl.cpp:372:12:372:26 | call to source | | structlikeclass.cpp:35:8:35:9 | s1 | structlikeclass.cpp:29:22:29:27 | call to source | | structlikeclass.cpp:36:8:36:9 | s2 | structlikeclass.cpp:30:24:30:29 | call to source | | structlikeclass.cpp:37:8:37:9 | s3 | structlikeclass.cpp:29:22:29:27 | call to source | diff --git a/cpp/ql/test/library-tests/dataflow/taint-tests/test_diff.expected b/cpp/ql/test/library-tests/dataflow/taint-tests/test_diff.expected index be3b27ea69d..7704bbf9bf0 100644 --- a/cpp/ql/test/library-tests/dataflow/taint-tests/test_diff.expected +++ b/cpp/ql/test/library-tests/dataflow/taint-tests/test_diff.expected @@ -30,26 +30,36 @@ | movableclass.cpp:55:8:55:9 | movableclass.cpp:52:23:52:28 | AST only | | movableclass.cpp:64:8:64:9 | movableclass.cpp:23:55:23:60 | AST only | | movableclass.cpp:65:11:65:11 | movableclass.cpp:65:13:65:18 | AST only | -| stl.cpp:103:7:103:7 | stl.cpp:99:16:99:21 | AST only | -| stl.cpp:105:9:105:13 | stl.cpp:99:16:99:21 | AST only | -| stl.cpp:155:13:155:17 | stl.cpp:147:10:147:15 | AST only | -| stl.cpp:159:13:159:17 | stl.cpp:147:10:147:15 | AST only | -| stl.cpp:162:13:162:17 | stl.cpp:147:10:147:15 | AST only | -| stl.cpp:172:7:172:8 | stl.cpp:167:19:167:26 | IR only | -| stl.cpp:173:7:173:8 | stl.cpp:167:19:167:24 | AST only | -| stl.cpp:186:7:186:8 | stl.cpp:178:19:178:24 | AST only | -| stl.cpp:187:7:187:8 | stl.cpp:178:19:178:24 | AST only | -| stl.cpp:209:8:209:9 | stl.cpp:204:18:204:23 | AST only | -| stl.cpp:210:8:210:9 | stl.cpp:205:20:205:25 | AST only | -| stl.cpp:211:8:211:9 | stl.cpp:207:8:207:13 | AST only | -| stl.cpp:230:8:230:9 | stl.cpp:226:32:226:37 | AST only | -| stl.cpp:231:8:231:9 | stl.cpp:228:20:228:25 | AST only | -| stl.cpp:240:8:240:8 | stl.cpp:238:16:238:21 | AST only | -| stl.cpp:248:8:248:8 | stl.cpp:238:16:238:21 | AST only | -| stl.cpp:253:8:253:8 | stl.cpp:251:28:251:33 | AST only | -| stl.cpp:295:8:295:8 | stl.cpp:288:43:288:49 | AST only | -| stl.cpp:303:8:303:8 | stl.cpp:288:43:288:49 | AST only | -| stl.cpp:308:8:308:8 | stl.cpp:288:43:288:49 | AST only | +| stl.cpp:115:7:115:7 | stl.cpp:111:16:111:21 | AST only | +| stl.cpp:117:9:117:13 | stl.cpp:111:16:111:21 | AST only | +| stl.cpp:167:13:167:17 | stl.cpp:159:10:159:15 | AST only | +| stl.cpp:171:13:171:17 | stl.cpp:159:10:159:15 | AST only | +| stl.cpp:174:13:174:17 | stl.cpp:159:10:159:15 | AST only | +| stl.cpp:184:7:184:8 | stl.cpp:179:19:179:26 | IR only | +| stl.cpp:185:7:185:8 | stl.cpp:179:19:179:24 | AST only | +| stl.cpp:198:7:198:8 | stl.cpp:190:19:190:24 | AST only | +| stl.cpp:199:7:199:8 | stl.cpp:190:19:190:24 | AST only | +| stl.cpp:221:8:221:9 | stl.cpp:216:18:216:23 | AST only | +| stl.cpp:222:8:222:9 | stl.cpp:217:20:217:25 | AST only | +| stl.cpp:223:8:223:9 | stl.cpp:219:8:219:13 | AST only | +| stl.cpp:242:8:242:9 | stl.cpp:238:32:238:37 | AST only | +| stl.cpp:243:8:243:9 | stl.cpp:240:20:240:25 | AST only | +| stl.cpp:252:8:252:8 | stl.cpp:250:16:250:21 | AST only | +| stl.cpp:260:8:260:8 | stl.cpp:250:16:250:21 | AST only | +| stl.cpp:265:8:265:8 | stl.cpp:263:28:263:33 | AST only | +| stl.cpp:307:8:307:8 | stl.cpp:300:43:300:49 | AST only | +| stl.cpp:315:8:315:8 | stl.cpp:300:43:300:49 | AST only | +| stl.cpp:320:8:320:8 | stl.cpp:300:43:300:49 | AST only | +| stl.cpp:335:11:335:11 | stl.cpp:332:18:332:23 | AST only | +| stl.cpp:336:11:336:11 | stl.cpp:332:18:332:23 | AST only | +| stl.cpp:337:11:337:11 | stl.cpp:332:18:332:23 | AST only | +| stl.cpp:340:11:340:11 | stl.cpp:340:13:340:18 | AST only | +| stl.cpp:349:8:349:9 | stl.cpp:345:18:345:23 | AST only | +| stl.cpp:353:8:353:9 | stl.cpp:345:18:345:23 | AST only | +| stl.cpp:358:8:358:9 | stl.cpp:356:9:356:14 | AST only | +| stl.cpp:362:8:362:9 | stl.cpp:345:18:345:23 | AST only | +| stl.cpp:367:8:367:9 | stl.cpp:365:13:365:18 | AST only | +| stl.cpp:375:8:375:10 | stl.cpp:372:12:372:26 | AST only | | structlikeclass.cpp:35:8:35:9 | structlikeclass.cpp:29:22:29:27 | AST only | | structlikeclass.cpp:36:8:36:9 | structlikeclass.cpp:30:24:30:29 | AST only | | structlikeclass.cpp:37:8:37:9 | structlikeclass.cpp:29:22:29:27 | AST only | diff --git a/cpp/ql/test/library-tests/dataflow/taint-tests/test_ir.expected b/cpp/ql/test/library-tests/dataflow/taint-tests/test_ir.expected index 62debb5d11f..463637d73e0 100644 --- a/cpp/ql/test/library-tests/dataflow/taint-tests/test_ir.expected +++ b/cpp/ql/test/library-tests/dataflow/taint-tests/test_ir.expected @@ -1,10 +1,10 @@ | format.cpp:157:7:157:22 | (int)... | format.cpp:147:12:147:25 | call to source | | format.cpp:157:7:157:22 | access to array | format.cpp:147:12:147:25 | call to source | | format.cpp:158:7:158:27 | ... + ... | format.cpp:148:16:148:30 | call to source | -| stl.cpp:101:7:101:7 | (const char *)... | stl.cpp:97:12:97:17 | call to source | -| stl.cpp:101:7:101:7 | a | stl.cpp:97:12:97:17 | call to source | -| stl.cpp:172:7:172:8 | cs | stl.cpp:167:19:167:24 | call to source | -| stl.cpp:172:7:172:8 | cs | stl.cpp:167:19:167:26 | (const char *)... | +| stl.cpp:113:7:113:7 | (const char *)... | stl.cpp:109:12:109:17 | call to source | +| stl.cpp:113:7:113:7 | a | stl.cpp:109:12:109:17 | call to source | +| stl.cpp:184:7:184:8 | cs | stl.cpp:179:19:179:24 | call to source | +| stl.cpp:184:7:184:8 | cs | stl.cpp:179:19:179:26 | (const char *)... | | structlikeclass.cpp:38:8:38:9 | s4 | structlikeclass.cpp:33:8:33:13 | call to source | | structlikeclass.cpp:61:8:61:9 | s2 | structlikeclass.cpp:58:24:58:29 | call to source | | structlikeclass.cpp:62:8:62:20 | ... = ... | structlikeclass.cpp:62:13:62:18 | call to source |