@@ -43,7 +43,13 @@ class NetworkSend extends NetworkSendRecv {
4343
4444 NetworkSend ( ) { target = this .getTarget ( ) }
4545
46- override Expr getSocketExpr ( ) { result = this .getArgument ( 0 ) }
46+ override Expr getSocketExpr ( ) {
47+ exists ( FunctionInput input , int arg |
48+ target .hasSocketInput ( input ) and
49+ input .isParameter ( arg ) and
50+ result = this .getArgument ( arg )
51+ )
52+ }
4753
4854 override Expr getDataExpr ( ) {
4955 exists ( FunctionInput input , int arg |
@@ -62,7 +68,13 @@ class NetworkRecv extends NetworkSendRecv {
6268
6369 NetworkRecv ( ) { target = this .getTarget ( ) }
6470
65- override Expr getSocketExpr ( ) { result = this .getArgument ( 0 ) }
71+ override Expr getSocketExpr ( ) {
72+ exists ( FunctionInput input , int arg |
73+ target .hasSocketInput ( input ) and
74+ input .isParameter ( arg ) and
75+ result = this .getArgument ( arg )
76+ )
77+ }
6678
6779 override Expr getDataExpr ( ) {
6880 exists ( FunctionOutput output , int arg |
@@ -85,7 +97,7 @@ class SensitiveSendRecvConfiguration extends TaintTracking::Configuration {
8597 override predicate isSink ( DataFlow:: Node sink ) {
8698 exists ( NetworkSendRecv transmission |
8799 sink .asExpr ( ) = transmission .getDataExpr ( ) and
88- // a zero file descriptor is standard input, which is not interesting for this query.
100+ // a zero socket descriptor is standard input, which is not interesting for this query.
89101 not exists ( Zero zero |
90102 DataFlow:: localFlow ( DataFlow:: exprNode ( zero ) ,
91103 DataFlow:: exprNode ( transmission .getSocketExpr ( ) ) )
0 commit comments