You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The control flow graph (CFG) that is returned by the gen_cfg function does not cover certain program statements, such as raise, try, except or class. Also excluded are statements that are part of try/except blocks or class definitions.
As one example, in the Control Flow chapter of The Fuzzing Book, the control flow graph that corresponds to the cgi_decode function (generated via to_graph(gen_cfg(inspect.getsource(cgi_decode)))) does not have a node that corresponds to the raise ValueError("Invalid encoding") statement.
The resulting CFG, shown in the screenshot below, does not contain nodes that correspond to the statements print( 'a' ) and print( 'b' ), which are part of the try and catch block, respectively.
A third example is:
from fuzzingbook import ControlFlow as cf
import inspect
import html.parser
cf.to_graph(cf.gen_cfg(inspect.getsource(html.parser.HTMLParser)))
The resulting CFG is empty, since all statements are part of the HTMLParser class.
Describe the solution you'd like
Ideally, all relevant program statements would be included as nodes in the CFG, with appropriate edges.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
The control flow graph (CFG) that is returned by the
gen_cfg
function does not cover certain program statements, such asraise
,try
,except
orclass
. Also excluded are statements that are part oftry
/except
blocks orclass
definitions.As one example, in the Control Flow chapter of The Fuzzing Book, the control flow graph that corresponds to the
cgi_decode
function (generated viato_graph(gen_cfg(inspect.getsource(cgi_decode)))
) does not have a node that corresponds to theraise ValueError("Invalid encoding")
statement.Another example is as follows:
The resulting CFG, shown in the screenshot below, does not contain nodes that correspond to the statements
print( 'a' )
andprint( 'b' )
, which are part of thetry
andcatch
block, respectively.A third example is:
The resulting CFG is empty, since all statements are part of the
HTMLParser
class.Describe the solution you'd like
Ideally, all relevant program statements would be included as nodes in the CFG, with appropriate edges.
The text was updated successfully, but these errors were encountered: