Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 77ae91c

Browse files
committed
Python: Add concept ExceptionSource
1 parent 8a2e063 commit 77ae91c

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

python/ql/src/semmle/python/Concepts.qll

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,41 @@ module SqlExecution {
293293
}
294294
}
295295

296+
/**
297+
* A data-flow node that carries information about an error. Such information should
298+
* rarely be exposed directly to the user.
299+
*
300+
* Extend this class to refine existing API models. If you want to model new APIs,
301+
* extend `ErrorInfoSource::Range` instead.
302+
*/
303+
class ErrorInfoSource extends DataFlow::Node {
304+
ErrorInfoSource::Range range;
305+
306+
ErrorInfoSource() { this = range }
307+
}
308+
309+
/** Provides a class for modeling new sources of error information, say via APIs. */
310+
module ErrorInfoSource {
311+
abstract class Range extends DataFlow::Node { }
312+
}
313+
314+
/**
315+
* A data-flow node that represents the creation or introduction of an exception.
316+
*
317+
* Extend this class to refine existing API models. If you want to model new APIs,
318+
* extend `ExceptionSource::Range` instead.
319+
*/
320+
class ExceptionSource extends ErrorInfoSource::Range {
321+
ExceptionSource::Range range;
322+
323+
ExceptionSource() { this = range }
324+
}
325+
326+
/** Provides a class for modeling new sources of exceptions, say via APIs. */
327+
module ExceptionSource {
328+
abstract class Range extends DataFlow::Node { }
329+
}
330+
296331
/** Provides classes for modeling HTTP-related APIs. */
297332
module HTTP {
298333
import semmle.python.web.HttpConstants

0 commit comments

Comments
 (0)