Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Commit 4127cb5

Browse files
committed
Remove rune/byte read/write from TaintStep/io.go
1 parent 07fdd3d commit 4127cb5

File tree

2 files changed

+25
-45
lines changed

2 files changed

+25
-45
lines changed

ql/test/library-tests/semmle/go/frameworks/TaintSteps/TaintStep.expected

Lines changed: 25 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -34,38 +34,31 @@
3434
| io.go:60:18:60:21 | &... | io.go:59:7:59:9 | definition of buf |
3535
| io.go:60:19:60:21 | buf | io.go:60:18:60:21 | &... |
3636
| io.go:61:21:61:26 | "test" | io.go:60:3:60:3 | definition of w |
37-
| io.go:65:31:65:43 | "some string" | io.go:65:13:65:44 | call to NewReader |
38-
| io.go:66:11:66:27 | call to ReadByte | io.go:66:3:66:27 | ... := ...[0] |
39-
| io.go:66:11:66:27 | call to ReadByte | io.go:66:3:66:27 | ... := ...[1] |
40-
| io.go:72:31:72:43 | "some string" | io.go:72:13:72:44 | call to NewReader |
41-
| io.go:74:3:74:8 | reader | io.go:73:3:73:5 | definition of buf |
42-
| io.go:77:31:77:43 | "some string" | io.go:77:13:77:44 | call to NewReader |
43-
| io.go:79:3:79:8 | reader | io.go:78:3:78:5 | definition of buf |
44-
| io.go:83:31:83:43 | "some string" | io.go:83:13:83:44 | call to NewReader |
45-
| io.go:84:24:84:29 | reader | io.go:84:9:84:33 | call to LimitReader |
46-
| io.go:85:22:85:23 | lr | io.go:85:11:85:19 | selection of Stdout |
47-
| io.go:89:27:89:36 | "reader1 " | io.go:89:9:89:37 | call to NewReader |
48-
| io.go:90:27:90:36 | "reader2 " | io.go:90:9:90:37 | call to NewReader |
49-
| io.go:91:27:91:35 | "reader3" | io.go:91:9:91:36 | call to NewReader |
50-
| io.go:92:23:92:24 | r1 | io.go:92:8:92:33 | call to MultiReader |
51-
| io.go:92:27:92:28 | r2 | io.go:92:8:92:33 | call to MultiReader |
52-
| io.go:92:31:92:32 | r3 | io.go:92:8:92:33 | call to MultiReader |
53-
| io.go:93:22:93:22 | r | io.go:93:11:93:19 | selection of Stdout |
54-
| io.go:96:26:96:38 | "some string" | io.go:96:8:96:39 | call to NewReader |
55-
| io.go:98:23:98:23 | r | io.go:98:10:98:30 | call to TeeReader |
56-
| io.go:98:23:98:23 | r | io.go:98:26:98:29 | &... |
57-
| io.go:98:26:98:29 | &... | io.go:97:7:97:9 | definition of buf |
58-
| io.go:98:27:98:29 | buf | io.go:98:26:98:29 | &... |
59-
| io.go:100:22:100:24 | tee | io.go:100:11:100:19 | selection of Stdout |
60-
| io.go:103:26:103:38 | "some string" | io.go:103:8:103:39 | call to NewReader |
61-
| io.go:104:28:104:28 | r | io.go:104:8:104:36 | call to NewSectionReader |
62-
| io.go:105:22:105:22 | s | io.go:105:11:105:19 | selection of Stdout |
63-
| io.go:108:26:108:38 | "some string" | io.go:108:8:108:39 | call to NewReader |
64-
| io.go:109:16:109:27 | call to ReadRune | io.go:109:3:109:27 | ... := ...[0] |
65-
| io.go:109:16:109:27 | call to ReadRune | io.go:109:3:109:27 | ... := ...[1] |
66-
| io.go:109:16:109:27 | call to ReadRune | io.go:109:3:109:27 | ... := ...[2] |
67-
| io.go:113:26:113:38 | "some string" | io.go:113:8:113:39 | call to NewReader |
68-
| io.go:114:3:114:3 | r | io.go:114:13:114:21 | selection of Stdout |
37+
| io.go:64:31:64:43 | "some string" | io.go:64:13:64:44 | call to NewReader |
38+
| io.go:66:3:66:8 | reader | io.go:65:3:65:5 | definition of buf |
39+
| io.go:69:31:69:43 | "some string" | io.go:69:13:69:44 | call to NewReader |
40+
| io.go:71:3:71:8 | reader | io.go:70:3:70:5 | definition of buf |
41+
| io.go:75:31:75:43 | "some string" | io.go:75:13:75:44 | call to NewReader |
42+
| io.go:76:24:76:29 | reader | io.go:76:9:76:33 | call to LimitReader |
43+
| io.go:77:22:77:23 | lr | io.go:77:11:77:19 | selection of Stdout |
44+
| io.go:81:27:81:36 | "reader1 " | io.go:81:9:81:37 | call to NewReader |
45+
| io.go:82:27:82:36 | "reader2 " | io.go:82:9:82:37 | call to NewReader |
46+
| io.go:83:27:83:35 | "reader3" | io.go:83:9:83:36 | call to NewReader |
47+
| io.go:84:23:84:24 | r1 | io.go:84:8:84:33 | call to MultiReader |
48+
| io.go:84:27:84:28 | r2 | io.go:84:8:84:33 | call to MultiReader |
49+
| io.go:84:31:84:32 | r3 | io.go:84:8:84:33 | call to MultiReader |
50+
| io.go:85:22:85:22 | r | io.go:85:11:85:19 | selection of Stdout |
51+
| io.go:88:26:88:38 | "some string" | io.go:88:8:88:39 | call to NewReader |
52+
| io.go:90:23:90:23 | r | io.go:90:10:90:30 | call to TeeReader |
53+
| io.go:90:23:90:23 | r | io.go:90:26:90:29 | &... |
54+
| io.go:90:26:90:29 | &... | io.go:89:7:89:9 | definition of buf |
55+
| io.go:90:27:90:29 | buf | io.go:90:26:90:29 | &... |
56+
| io.go:92:22:92:24 | tee | io.go:92:11:92:19 | selection of Stdout |
57+
| io.go:95:26:95:38 | "some string" | io.go:95:8:95:39 | call to NewReader |
58+
| io.go:96:28:96:28 | r | io.go:96:8:96:36 | call to NewSectionReader |
59+
| io.go:97:22:97:22 | s | io.go:97:11:97:19 | selection of Stdout |
60+
| io.go:100:26:100:38 | "some string" | io.go:100:8:100:39 | call to NewReader |
61+
| io.go:101:3:101:3 | r | io.go:101:13:101:21 | selection of Stdout |
6962
| main.go:11:12:11:26 | call to Marshal | main.go:11:2:11:26 | ... := ...[0] |
7063
| main.go:11:12:11:26 | call to Marshal | main.go:11:2:11:26 | ... := ...[1] |
7164
| main.go:11:25:11:25 | v | main.go:11:2:11:26 | ... := ...[0] |

ql/test/library-tests/semmle/go/frameworks/TaintSteps/io.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,6 @@ func io2() {
6060
w := io.Writer(&buf)
6161
io.WriteString(w, "test")
6262
}
63-
64-
{
65-
reader := strings.NewReader("some string")
66-
t, _ := reader.ReadByte()
67-
var bwriter io.ByteWriter
68-
bwriter.WriteByte(t)
69-
}
70-
7163
{
7264
reader := strings.NewReader("some string")
7365
buf := make([]byte, 512)
@@ -104,11 +96,6 @@ func io2() {
10496
s := io.NewSectionReader(r, 5, 17)
10597
io.Copy(os.Stdout, s)
10698
}
107-
{
108-
r := strings.NewReader("some string")
109-
run, _, _ := r.ReadRune()
110-
fmt.Println(run)
111-
}
11299
{
113100
r := strings.NewReader("some string")
114101
r.WriteTo(os.Stdout)

0 commit comments

Comments
 (0)