File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
javascript/ql/test/library-tests/threat-models/sources Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -89,3 +89,32 @@ const rl_file = readline.createInterface({
89
89
rl_file . on ( "line" , ( line ) => {
90
90
SINK ( line ) ; // $ MISSING: hasFlow
91
91
} ) ;
92
+
93
+
94
+ // ------ reading from stdin ------
95
+
96
+ // Accessing stdin using process.stdin
97
+ process . stdin . on ( 'data' , ( data ) => { // $ MISSING: threat-source=stdin
98
+ SINK ( data ) ; // $ MISSING: hasFlow
99
+ } ) ;
100
+
101
+ const stdin_line = process . stdin . read ( ) ; // $ MISSING: threat-source=stdin
102
+ SINK ( stdin_line ) ; // $ MISSING: hasFlow
103
+
104
+ // Accessing stdin using readline
105
+ const readline = require ( 'readline' ) ;
106
+ const rl_stdin = readline . createInterface ( {
107
+ input : process . stdin // $ MISSING: threat-source=stdin
108
+ } ) ;
109
+ rl_stdin . question ( '<question>' , ( answer ) => {
110
+ SINK ( answer ) ; // $ MISSING: hasFlow
111
+ } ) ;
112
+
113
+ function handler ( answer ) {
114
+ SINK ( answer ) ; // $ MISSING: hasFlow
115
+ }
116
+ rl_stdin . question ( '<question>' , handler ) ;
117
+
118
+ rl_stdin . on ( "line" , ( line ) => {
119
+ SINK ( line ) ; // $ MISSING: hasFlow
120
+ } ) ;
You can’t perform that action at this time.
0 commit comments