File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed
lib/codeql/ruby/frameworks
test/library-tests/frameworks Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -483,14 +483,21 @@ private module Persistence {
483
483
* as an `OrmWriteAccess` to avoid missing cases where the path to a
484
484
* subsequent write is not clear.
485
485
*/
486
- private class AssignAttributeCall extends DataFlow:: CallNode , ActiveRecordInstanceMethodCall ,
487
- OrmWriteAccess:: Range {
488
- AssignAttributeCall ( ) { this .asExpr ( ) .getExpr ( ) instanceof SetterMethodCall }
486
+ private class AssignAttribute extends DataFlow:: Node , OrmWriteAccess:: Range {
487
+ private DataFlow:: CallNode setter ;
488
+ private ExprNodes:: AssignExprCfgNode assignNode ;
489
+
490
+ AssignAttribute ( ) {
491
+ assignNode = this .asExpr ( ) and
492
+ setter .getArgument ( 0 ) = this and
493
+ setter instanceof ActiveRecordInstanceMethodCall and
494
+ setter .asExpr ( ) .getExpr ( ) instanceof SetterMethodCall
495
+ }
489
496
490
497
override string getFieldNameAssignedTo ( DataFlow:: Node value ) {
491
- result + "=" = this .getMethodName ( ) and
498
+ result + "=" = setter .getMethodName ( ) and
492
499
// match RHS
493
- this . getArgument ( 0 ) . asExpr ( ) . ( ExprNodes :: AssignExprCfgNode ) .getRhs ( ) = value .asExpr ( )
500
+ assignNode .getRhs ( ) = value .asExpr ( )
494
501
}
495
502
}
496
503
}
Original file line number Diff line number Diff line change 13
13
| app/controllers/users/users_controller.rb:20:7:20:57 | call to update_attributes | name | app/controllers/users/users_controller.rb:20:37:20:41 | "U12" |
14
14
| app/controllers/users/users_controller.rb:20:7:20:57 | call to update_attributes | uid | app/controllers/users/users_controller.rb:20:49:20:55 | call to get_uid |
15
15
| app/controllers/users/users_controller.rb:23:7:23:42 | call to update_attribute | name | app/controllers/users/users_controller.rb:23:37:23:41 | "U13" |
16
- | app/controllers/users/users_controller.rb:26:7:26:15 | call to name= | name | app/controllers/users/users_controller.rb:26:19:26:23 | "U14" |
16
+ | app/controllers/users/users_controller.rb:26:7:26:15 | ... = ... | name | app/controllers/users/users_controller.rb:26:19:26:23 | "U14" |
You can’t perform that action at this time.
0 commit comments