diff --git a/.github/codeql.yml b/.github/codeql.yml index 1d8a969..4f29b17 100644 --- a/.github/codeql.yml +++ b/.github/codeql.yml @@ -1,5 +1,6 @@ paths-ignore: - testsuite + - testmxml.c query-filters: - exclude: @@ -46,3 +47,6 @@ query-filters: id: cpp/nested-loops-with-same-variable - exclude: id: cpp/stack-address-escape + - exclude: + id: cpp/world-writable-file-creation + diff --git a/mxml-file.c b/mxml-file.c index 81d4ed2..4bd1454 100644 --- a/mxml-file.c +++ b/mxml-file.c @@ -556,7 +556,7 @@ mxmlSaveIO( if (col > 0) { // Make sure the file ends with a newline... - if ((io_cb)(io_cbdata, "\n", 1) < 0) + if ((io_cb)(io_cbdata, "\n", 1) != 1) return (false); } @@ -914,8 +914,6 @@ mxml_getc(mxml_options_t *options, // I - Options break; } -// MXML_DEBUG("mxml_getc: %c (0x%04x)\n", ch < ' ' ? '.' : ch, ch); - if (mxml_bad_char(ch)) { _mxml_error(options, "Bad control character 0x%02x not allowed by XML standard.", ch); diff --git a/testmxml.c b/testmxml.c index c54f484..cdd3106 100644 --- a/testmxml.c +++ b/testmxml.c @@ -57,7 +57,6 @@ main(int argc, // I - Number of command-line args *tree, // Element tree *node; // Node which should be in test.xml mxml_index_t *ind; // XML index - mxml_type_t type; // Node type char buffer[16384]; // Save string const char *text; // Text string bool whitespace; // Whitespace before text string