Skip to content

Commit d2b0d7a

Browse files
Add missing qldoc
1 parent 89167da commit d2b0d7a

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,15 @@ module Lxml {
387387
module ElementTree {
388388
API::Node classRef() { result = etreeRef().getMember("ElementTree") }
389389

390+
/**
391+
* A source of instances of `lxml.etree.ElementTree` instances, extend this class to model new instances.
392+
*
393+
* This can include instantiations of the class, return values from function
394+
* calls, or a special parameter that will be set when functions are called by an external
395+
* library.
396+
*
397+
* Use the predicate `ElementTree::instance()` to get references to instances of `lxml.etree.ElementTree` instances.
398+
*/
390399
abstract class InstanceSource extends DataFlow::LocalSourceNode { }
391400

392401
/** Gets a reference to an `lxml.etree.ElementTree` instance.` */
@@ -397,7 +406,7 @@ module Lxml {
397406
exists(DataFlow::TypeTracker t2 | result = instance(t2).track(t2, t))
398407
}
399408

400-
/** Gets a reference to an `lxml.etree.ElementTree` parsers instance. */
409+
/** Gets a reference to an `lxml.etree.ElementTree` instance. */
401410
DataFlow::Node instance() { instance(DataFlow::TypeTracker::end()).flowsTo(result) }
402411

403412
/** An `ElementTree` instantiated directly. */
@@ -439,7 +448,9 @@ module Lxml {
439448

440449
/** A call to serialise xml to a string */
441450
private class XmlEncoding extends Encoding::Range, DataFlow::CallCfgNode {
442-
XmlEncoding() { this = etreeRef().getMember("tostring").getACall() }
451+
XmlEncoding() {
452+
this = etreeRef().getMember(["tostring", "tostringlist", "tounicode"]).getACall()
453+
}
443454

444455
override DataFlow::Node getAnInput() {
445456
result = [this.getArg(0), this.getArgByName("element_or_tree")]

shared/threat-models/ext/supported-threat-models.model.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ extensions:
44
extensible: threatModelConfiguration
55
data:
66
- ["default", true, -2147483648] # The "default" threat model is included by default
7+
- ["all", true, 1]

0 commit comments

Comments
 (0)