Skip to content

Commit fb90089

Browse files
committed
python: rewrite model for Aiohttp
1 parent db616a5 commit fb90089

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -621,15 +621,12 @@ module AiohttpWebModel {
621621
DataFlow::Node value;
622622

623623
AiohttpResponseCookieSubscriptWrite() {
624-
exists(SubscriptNode subscript |
624+
exists(API::Node i |
625+
value = aiohttpResponseInstance().getMember("cookies").getSubscriptAt(i).asSink() and
626+
index = i.asSink() and
625627
// To give `this` a value, we need to choose between either LHS or RHS,
626-
// and just go with the LHS
627-
this.asCfgNode() = subscript
628-
|
629-
subscript.getObject() =
630-
aiohttpResponseInstance().getMember("cookies").getAValueReachableFromSource().asCfgNode() and
631-
value.asCfgNode() = subscript.(DefinitionNode).getValue() and
632-
index.asCfgNode() = subscript.getIndex()
628+
// and just go with the RHS as it is readily available
629+
this = value
633630
)
634631
}
635632

0 commit comments

Comments
 (0)