Skip to content

Commit

Permalink
Add missing qldoc
Browse files Browse the repository at this point in the history
  • Loading branch information
joefarebrother committed Dec 4, 2024
1 parent 5636345 commit a7a5e62
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
15 changes: 13 additions & 2 deletions python/ql/lib/semmle/python/frameworks/Lxml.qll
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,15 @@ module Lxml {
module ElementTree {
API::Node classRef() { result = etreeRef().getMember("ElementTree") }

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

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

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

/** An `ElementTree` instantiated directly. */
Expand Down Expand Up @@ -439,7 +448,9 @@ module Lxml {

/** A call to serialise xml to a string */
private class XmlEncoding extends Encoding::Range, DataFlow::CallCfgNode {
XmlEncoding() { this = etreeRef().getMember("tostring").getACall() }
XmlEncoding() {
this = etreeRef().getMember(["tostring", "tostringlist", "tounicode"]).getACall()
}

override DataFlow::Node getAnInput() {
result = [this.getArg(0), this.getArgByName("element_or_tree")]
Expand Down
1 change: 1 addition & 0 deletions shared/threat-models/ext/supported-threat-models.model.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ extensions:
extensible: threatModelConfiguration
data:
- ["default", true, -2147483648] # The "default" threat model is included by default
- ["all", true, 1]

0 comments on commit a7a5e62

Please sign in to comment.