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
When using joern-export to export a CPG in dot format, it fails to escape special characters (e.g., %d) or double quotes inside the CODE attribute of each node. Thus the generated dot file is not valid.
To Reproduce
I used exactly the same x42.c file which is provided in the quickstart guide.
joern-parse x42.c
joern-export --repr=cpg --format=dot cpg.bin
Using pydot in python: graph = pydot.graph_from_dot_file("out/x42.c/main.dot")[0]
See error:
30064771079[label=CALL ARGUMENT_INDEX="-1" CODE="printf("What is the meaning of life?\n")" COLUMN_NUMBER="3" DISPATCH_TYPE="STATIC_DISPATCH" LINE_NUMBER="10" METHOD_FULL_NAME="printf" NAME="printf" ORDER="2" SIGNATURE="" TYPE_FULL_NAME="ANY"]
^
Expected '}', found '[' (at char 23), (line:2, col:14)
After escaping (\") all double quotes and special chars inside CODE attribute, the dot file can be read correctly.
Describe the bug
When using
joern-export
to export a CPG in dot format, it fails to escape special characters (e.g., %d) or double quotes inside the CODE attribute of each node. Thus the generated dot file is not valid.To Reproduce
I used exactly the same x42.c file which is provided in the quickstart guide.
joern-parse x42.c
joern-export --repr=cpg --format=dot cpg.bin
graph = pydot.graph_from_dot_file("out/x42.c/main.dot")[0]
(\")
all double quotes and special chars inside CODE attribute, the dot file can be read correctly.Expected behavior
joern-export should automatically escape invalid characters inside node attribute fields.
Screenshots
Desktop (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: