From: Tamas Nepusz Date: Thu, 6 Dec 2018 08:02:45 +0000 (+0100) Subject: [PATCH] fix a crash when loading malformed GraphML files, closes #1141 This fixes... X-Git-Tag: archive/raspbian/0.8.2+ds-1+rpi1~1^2^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=b08ee13a26e4781abf87fd8032bcfd04e8007000;p=igraph.git [PATCH] fix a crash when loading malformed GraphML files, closes #1141 This fixes CVE-2018-20349 Thanks to Zhao Liang, Huawei Weiran Labs Gbp-Pq: Name fix_broken_graph_ml.patch --- diff --git a/examples/simple/graphml-malformed.xml b/examples/simple/graphml-malformed.xml new file mode 100644 index 0000000..32a879f --- /dev/null +++ b/examples/simple/graphml-malformed.xml @@ -0,0 +1,30 @@ + + + + yellYw + + + + 1 + ta> + green + + true + + + + blue + 0 + red "w" + + false + + + t + + i + + + + tag, ignoring attribute", + __FILE__, __LINE__, 0, + key + ); + igraph_Free(state->data_char); + return; + } + igraph_trie_check(trie, key, &recid); if (recid < 0) { /* no such attribute key, issue a warning */ diff --git a/tests/foreign.at b/tests/foreign.at index b1918ea..0a76ce6 100644 --- a/tests/foreign.at +++ b/tests/foreign.at @@ -29,7 +29,7 @@ AT_CLEANUP AT_SETUP([GraphML (igraph_{read,write}_graph_graphml):]) AT_KEYWORDS([igraph_read_graph_graphml igraph_write_graph_graphml foreign graphml]) AT_COMPILE_CHECK([simple/graphml.c], [simple/graphml.out], - [simple/{test.gxl,graphml-hsa05010.xml}]) + [simple/{test.gxl,graphml-hsa05010.xml,graphml-malformed.xml}]) AT_CLEANUP AT_SETUP([Writing Pajek (igraph_write_graph_pajek):])