Skip to content

Commit bbba1a2

Browse files
committed
Explicitly call this in SendGridMail
1 parent 930fbf7 commit bbba1a2

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

  • python/ql/src/experimental/semmle/python/frameworks

python/ql/src/experimental/semmle/python/frameworks/Sendgrid.qll

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,14 @@ private module Sendgrid {
9999
]
100100
or
101101
result in [
102-
sendgridContent([
102+
this.sendgridContent([
103103
this.getMailCall().getArg(3), this.getMailCall().getArgByName("plain_text_content")
104104
].getALocalSource(), "text/plain"),
105-
sendgridContent(sendgridMailInstance().getMember("add_content").getACall(), "text/plain")
105+
this.sendgridContent(sendgridMailInstance().getMember("add_content").getACall(),
106+
"text/plain")
106107
]
107108
or
108-
result = sendgridWrite("plain_text_content")
109+
result = this.sendgridWrite("plain_text_content")
109110
}
110111

111112
override DataFlow::Node getHtmlBody() {
@@ -114,11 +115,11 @@ private module Sendgrid {
114115
result = this.getMailCall().getAMethodCall("set_html").getArg(0)
115116
or
116117
result =
117-
sendgridContent([
118+
this.sendgridContent([
118119
this.getMailCall().getArg(4), this.getMailCall().getArgByName("html_content")
119120
].getALocalSource(), ["text/html", "text/x-amp-html"])
120121
or
121-
result = sendgridWrite("html_content")
122+
result = this.sendgridWrite("html_content")
122123
or
123124
exists(KeyValuePair content, Dict generalDict, KeyValuePair typePair, KeyValuePair valuePair |
124125
content.getKey().(StrConst).getText() = "content" and
@@ -175,15 +176,15 @@ private module Sendgrid {
175176
or
176177
result = this.getMailCall().getAMethodCall(["from_email", "set_from"]).getArg(0)
177178
or
178-
result = sendgridWrite("from_email")
179+
result = this.sendgridWrite("from_email")
179180
}
180181

181182
override DataFlow::Node getSubject() {
182183
result in [this.getMailCall().getArg(2), this.getMailCall().getArgByName("subject")]
183184
or
184185
result = this.getMailCall().getAMethodCall(["subject", "set_subject"]).getArg(0)
185186
or
186-
result = sendgridWrite("subject")
187+
result = this.sendgridWrite("subject")
187188
}
188189
}
189190
}

0 commit comments

Comments
 (0)