Skip to content

Commit 94bcda3

Browse files
committed
Python: Highlight problem picking DataFlow::Node for Assign
1 parent 9573048 commit 94bcda3

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

python/ql/src/semmle/python/frameworks/Aiohttp.qll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -646,8 +646,9 @@ module AiohttpWebModel {
646646

647647
AiohttpResponseCookieSubscriptWrite() {
648648
exists(Assign assign, Subscript subscript |
649-
// there doesn't seem to be any _good_ choice for `this`, so just picking the
650-
// whole subscript...
649+
// Since there is no `DataFlow::Node` for the assign (since it's a statement,
650+
// and not an expression) there doesn't seem to be any _good_ choice for `this`,
651+
// so just picking the whole subscript...
651652
this.asExpr() = subscript
652653
|
653654
assign.getATarget() = subscript and

python/ql/src/semmle/python/frameworks/Django.qll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,8 +1413,9 @@ private module PrivateDjango {
14131413

14141414
DjangoResponseCookieSubscriptWrite() {
14151415
exists(Assign assign, Subscript subscript, DataFlow::AttrRead cookieLookup |
1416-
// there doesn't seem to be any _good_ choice for `this`, so just picking the
1417-
// whole subscript...
1416+
// Since there is no `DataFlow::Node` for the assign (since it's a statement,
1417+
// and not an expression) there doesn't seem to be any _good_ choice for `this`,
1418+
// so just picking the whole subscript...
14181419
this.asExpr() = subscript
14191420
|
14201421
cookieLookup.getAttributeName() = "cookies" and

0 commit comments

Comments
 (0)