Fuzz introspector

Project overview

High level conclusions

Fuzzers reach 23.88% of cyclomatic complexity. Improvements could be made
Fuzzers reach 20.96% of all functions. Improvements need to be made

Reachability and coverage overview

Functions statically reachable by fuzzers
20.96%
739/3525
Cyclomatic complexity statically reachable by fuzzers
23.89%
10651/44587
Functions covered at runtime
453

Fuzzers overview

Fuzzer Fuzzer filename Functions Reached Functions unreached Fuzzer depth Files reached Basic blocks reached Cyclomatic complexity Details
xmlsec_fuzzer xmlsec/tests/oss-fuzz/xmlsec_target.c 739 2786 28 30 27232 10651 xmlsec_target.c

Fuzzer details

Fuzzer: xmlsec_fuzzer

Call tree

The following is the call tree with color coding for whichfunctions are hit/not hit. This info is based on the coverageachieved of all fuzzers together and not just this specific fuzzer.

  • Red: not hit at all
  • Green: hit many times
  • Yellow: hit a few times

For further technical details on what the call tree overview is, please see the Glossary .

Full calltree

The following link provides a visualisation of the full calltree overlayed with coverage information: full calltree

For futher technical details on how the call tree is made, please see the Glossary .

Fuzz blockers

The followings nodes represent call sites where fuzz blockers occur

Amount of callsites blocked Calltree index Parent function Callsite Largest blocked function
386 1294 xmlSAXVersion call site xmlValidateOneElement
130 3616 xmlParseReference call site xmlParserEntityCheck
90 1705 xmlSplitQName call site xmlCheckDefaultedAttributes
51 1032 xmlIOErr call site __errno_location
48 3553 xmlParseBalancedChunkMemoryInternal call site xmlParseExternalEntityPrivate
45 488 xmlSetTreeDoc call site xmlStringGetNodeList
33 2089 xmlNewDoc call site xmlParseConditionalSections
32 647 xmlValidateNmtokenValueInternal call site xmlValidateAttributeValue2
32 3380 xmlParseStartTag2 call site xmlParseStartTag
31 2865 xmlAddElementDecl call site xmlAddElementDecl
28 1210 xmlListAppend call site xmlValidateOneAttribute
24 1269 xmlHashLookup2 call site xmlValidateAttributeCallback

Runtime coverage analysis

Covered functions
453
Functions that are reachable but not covered
299
Reachable functions
739
Percentage of reachable functions covered
59.54%
NB: The sum of covered functions and functions that are reachable but not covered need not be Reachable functions . This is because the reachability analysis is an approximation and thus at runtime some functions may be covered that are not included in the reachability analysis. This is a limitation our of our static analysis capabilities.
Function name source code lines source lines hit percentage hit

Files reached

filename functions hit
xmlsec/tests/oss-fuzz/xmlsec_target.c 2
libxml2/error.c 16
libxml2/globals.c 22
libxml2/threads.c 14
/ 31
libxml2/dict.c 13
libxml2/SAX2.c 46
libxml2/xmlstring.c 17
libxml2/parserInternals.c 23
libxml2/tree.c 90
libxml2/valid.c 85
libxml2/hash.c 25
libxml2/entities.c 19
xmlsecbuffer.c 9
xmlsecerrors.c 1
xmlsecparser.c 2
libxml2/parser.c 121
libxml2/xmlmemory.c 1
libxml2/encoding.c 16
libxml2/HTMLparser.c 5
libxml2/buf.c 20
libxml2/list.c 9
libxml2/xmlregexp.c 54
libxml2/chvalid.c 1
libxml2/xmlIO.c 18
libxml2/uri.c 32
libxml2/xmlunicode.c 37
libxml2/HTMLtree.c 1
libxml2/catalog.c 11
libxml2/xpath.c 1

Analyses and suggestions

Optimal target analysis

Remaining optimal interesting functions

The following table shows a list of functions that are optimal targets. Optimal targets are identified by finding the functions that in combination reaches a high amount of code coverage.

Func name Functions filename Arg count Args Function depth hitcount instr count bb count cyclomatic complexity Reachable functions Incoming references total cyclomatic complexity Unreached complexity
xmlSecXsltPushBin /src/xmlsec/src/xslt.c 5 ['struct._xmlSecTransform *', 'char *', 'int ', 'int ', 'struct._xmlSecTransformCtx *'] 47 0 856 202 85 1349 0 19599 9005
xmlTextReaderSchemaValidate /src/libxml2/xmlreader.c 2 ['struct._xmlTextReader *', 'char *'] 28 0 20 3 2 1232 0 18958 7561
xmlShell /src/libxml2/debugXML.c 4 ['struct._xmlDoc *', 'char *', 'func_type *', 'struct._IO_FILE *'] 43 0 2165 300 86 1272 0 18931 3639
xsltLoadStylesheetPI /src/libxslt/libxslt/xslt.c 1 ['struct._xmlDoc *'] 52 0 413 68 26 1233 0 17349 2391
xmlTextReaderNextTree /src/libxml2/xmlreader.c 1 ['struct._xmlTextReader *'] 51 0 192 24 11 1081 3 16481 647
xmlSecTransformC14NPopBin /src/xmlsec/src/c14n.c 5 ['struct._xmlSecTransform *', 'char *', 'int ', 'int *', 'struct._xmlSecTransformCtx *'] 24 0 898 227 101 278 0 3273 604
xmlDefaultExternalEntityLoader /src/libxml2/xmlIO.c 3 ['char *', 'char *', 'struct._xmlParserCtxt *'] 37 0 142 22 9 759 2 10991 422

Implementing fuzzers that target the above functions will improve reachability such that it becomes:

Functions statically reachable by fuzzers
67.04%
2363/3525
Cyclomatic complexity statically reachable by fuzzers
78.27%
34900 / 44587

All functions overview

The status of all functions in the project will be as follows if you implement fuzzers for these functions

Func name Functions filename Args Function call depth Reached by Fuzzers Fuzzers runtime hit Func lines hit % I Count BB Count Cyclomatic complexity Functions reached Reached by functions Accumulated cyclomatic complexity Undiscovered complexity

Runtime coverage analysis

This section gives analysis based on data about the runtime coverage information

For futher technical details on how this section is made, please see the Glossary .

Complex functions with low coverage

Func name Function total lines Lines covered at runtime percentage covered Reached by fuzzers
xmlSAX2ExternalSubset 109 7 6.422% ['xmlsec_fuzzer']
xmlSAX2EntityDecl 54 20 37.03% ['xmlsec_fuzzer']
xmlSAX2AttributeDecl 58 30 51.72% ['xmlsec_fuzzer']
xmlSAX2ElementDecl 36 15 41.66% ['xmlsec_fuzzer']
xmlSAX2NotationDecl 40 19 47.5% ['xmlsec_fuzzer']
xmlSAX2UnparsedEntityDecl 55 22 40.0% ['xmlsec_fuzzer']
xmlSAX2StartDocument 56 22 39.28% ['xmlsec_fuzzer']
xmlSAX2StartElementNs 232 110 47.41% ['xmlsec_fuzzer']
xmlSAX2ProcessingInstruction 53 28 52.83% ['xmlsec_fuzzer']
xmlSAX2Comment 51 28 54.90% ['xmlsec_fuzzer']
xmlSAX2AttributeNs 204 68 33.33% ['xmlsec_fuzzer']
xmlSAX2TextNode 76 30 39.47% ['xmlsec_fuzzer']
xmlSAX2Text 122 63 51.63% ['xmlsec_fuzzer']
xmlBufSetAllocationScheme 31 14 45.16% ['xmlsec_fuzzer']
xmlBufShrink 36 15 41.66% ['xmlsec_fuzzer']
xmlBufResize 112 44 39.28% ['xmlsec_fuzzer']
xmlBufAdd 48 23 47.91% ['xmlsec_fuzzer']
xmlBufGrowInternal 54 26 48.14% ['xmlsec_fuzzer']
xmlInitializeCatalog 79 41 51.89% ['xmlsec_fuzzer']
xmlFreeCatalogEntry 31 12 38.70% ['xmlsec_fuzzer']
xmlDictLookup 128 56 43.75% ['xmlsec_fuzzer']
xmlGetCharEncodingName 53 16 30.18% ['xmlsec_fuzzer']
xmlNewCharEncodingHandler 67 30 44.77% ['xmlsec_fuzzer']
xmlInitCharEncodingHandlers 50 23 46.0% ['xmlsec_fuzzer']
xmlGetCharEncodingHandler 124 34 27.41% ['xmlsec_fuzzer']
xmlFindCharEncodingHandler 137 60 43.79% ['xmlsec_fuzzer']
xmlCharEncCloseFunc 70 37 52.85% ['xmlsec_fuzzer']
__xmlRaiseError 179 98 54.74% ['xmlsec_fuzzer']
xmlReportError 182 84 46.15% ['xmlsec_fuzzer']
xmlHashUpdateEntry3 107 54 50.46% ['xmlsec_fuzzer']
xmlHashGrow 81 43 53.08% ['xmlsec_fuzzer']
xmlListCreate 31 14 45.16% ['xmlsec_fuzzer']
xmlParseReference 422 143 33.88% ['xmlsec_fuzzer']
xmlParseEntityRef 154 79 51.29% ['xmlsec_fuzzer']
xmlParsePEReference 134 63 47.01% ['xmlsec_fuzzer']
xmlParseDocTypeDecl 61 31 50.81% ['xmlsec_fuzzer']
xmlCreateMemoryParserCtxt 35 19 54.28% ['xmlsec_fuzzer']
xmlParserEntityCheck 131 5 3.816% ['xmlsec_fuzzer']
areBlanks 54 5 9.259% ['xmlsec_fuzzer']
xmlParseStringEntityRef 163 76 46.62% ['xmlsec_fuzzer']
xmlParseElementStart 121 63 52.06% ['xmlsec_fuzzer']
nsPush 39 20 51.28% ['xmlsec_fuzzer']
xmlCtxtUseOptionsInternal 128 47 36.71% ['xmlsec_fuzzer']
xmlCurrentChar 144 78 54.16% ['xmlsec_fuzzer']
xmlStringCurrentChar 97 37 38.14% ['xmlsec_fuzzer']
xmlSwitchEncoding 117 64 54.70% ['xmlsec_fuzzer']
xmlNewEntityInputStream 53 16 30.18% ['xmlsec_fuzzer']
xmlInitParserCtxt 174 91 52.29% ['xmlsec_fuzzer']
xmlSwitchInputEncodingInt 125 53 42.4% ['xmlsec_fuzzer']
xmlRMutexLock 35 10 28.57% ['xmlsec_fuzzer']
__xmlGlobalInitMutexLock 72 7 9.722% ['xmlsec_fuzzer']
xmlOnceInit 34 6 17.64% ['xmlsec_fuzzer']
xmlSplitQName2 46 18 39.13% ['xmlsec_fuzzer']
xmlNewNs 64 31 48.43% ['xmlsec_fuzzer']
xmlNewDtd 38 17 44.73% ['xmlsec_fuzzer']
xmlCreateIntSubset 97 45 46.39% ['xmlsec_fuzzer']
xmlNewDoc 39 18 46.15% ['xmlsec_fuzzer']
xmlFreeDoc 54 29 53.70% ['xmlsec_fuzzer']
xmlStringLenGetNodeList 212 115 54.24% ['xmlsec_fuzzer']
xmlNodeListGetString 74 19 25.67% ['xmlsec_fuzzer']
xmlNewDocPI 35 17 48.57% ['xmlsec_fuzzer']
xmlNewReference 46 20 43.47% ['xmlsec_fuzzer']
xmlSetTreeDoc 56 14 25.0% ['xmlsec_fuzzer']
xmlAddNextSibling 60 19 31.66% ['xmlsec_fuzzer']
xmlAddChild 115 38 33.04% ['xmlsec_fuzzer']
xmlFreeNode 63 34 53.96% ['xmlsec_fuzzer']
xmlUnlinkNode 62 32 51.61% ['xmlsec_fuzzer']
xmlNewPropInternal 80 36 45.0% ['xmlsec_fuzzer']
xmlSaveUri 265 125 47.16% ['xmlsec_fuzzer']
xmlBuildURI 247 35 14.17% ['xmlsec_fuzzer']
xmlAddElementDecl 207 82 39.61% ['xmlsec_fuzzer']
xmlAddNotationDecl 62 33 53.22% ['xmlsec_fuzzer']
xmlAddID 70 37 52.85% ['xmlsec_fuzzer']
xmlAddRef 89 28 31.46% ['xmlsec_fuzzer']
__xmlIOErr 166 8 4.819% ['xmlsec_fuzzer']
xmlParserInputBufferGrow 84 42 50.0% ['xmlsec_fuzzer']