Skip to content

Commit f218e5d

Browse files
daniel-grumbergQuietMisdreavuswaldyriousioquatixkevinbackhouse
authored
integrate changes from cmark-gfm 0.29.0.gfm.12 and gfm.13 (#61) (#62)
* Normalize nomenclature: marker row vs. delimiter row The code for the table extension used the term 'marker row', but the spec calls it 'delimiter row'. This change normalizes the terminology so that it's consistent. * Update autolink.c ``` ../../../../ext/markly/autolink.c: In function ‘postprocess_text’: ../../../../ext/markly/autolink.c:364:31: warning: passing argument 1 of ‘validate_protocol’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 364 | if (validate_protocol("mailto:", data + start + offset + max_rewind, rewind, max_rewind)) { | ^~~~~~~~~ ../../../../ext/markly/commonmark.c: In function ‘S_render_node’: ../../../../ext/markly/autolink.c:299:36: note: expected ‘char *’ but argument is of type ‘const char *’ 299 | static bool validate_protocol(char protocol[], uint8_t *data, size_t rewind, size_t max_rewind) { | ~~~~~^~~~~~~~~~ ``` * Update commonmark.c ``` ../../../../ext/markly/commonmark.c:405:18: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 405 | emph_delim = "_"; | ^ ``` * Fix GHSL-2023-119: prevent quadratic performance by not allowing very deeply nested footnote definitions. * Fix GHSL-2023-117: store cell index on node so that it doesn't need to be recomputed during rendering. * Fix GHSL-2023-118: limit number of autocompleted table cells to prevent DOS. * Expose CMARK_NODE_FOOTNOTE_DEFINION literal value. In addition, fix a bug where the length of the literal value was calculated AFTER the actual literal string (null terminated) was allocated. * Update src/node.h * Rename custom_int -> cell_index. * Add newline * Remove unnecessary scope. * Create codeql.yml * Changelog and version bump for 0.29.0.12 * Fix format specifier for printing a size_t * Changelog and version bump for 0.29.0.13 * move cell index into node_cell_data --------- Co-authored-by: QuietMisdreavus <QuietMisdreavus@users.noreply.github.com> Co-authored-by: Waldir Pimenta <waldyrious@gmail.com> Co-authored-by: Samuel Williams <samuel.williams@oriontransfer.co.nz> Co-authored-by: Kevin Backhouse <kevinbackhouse@github.com> Co-authored-by: Phill MV <phillmv@github.com> Co-authored-by: Bas Alberts <13686387+anticomputer@users.noreply.github.com> Co-authored-by: Bas Alberts <anticomputer@github.com>
1 parent 2881850 commit f218e5d

File tree

10 files changed

+201
-57
lines changed

10 files changed

+201
-57
lines changed

Diff for: .github/workflows/codeql.yml

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ "master" ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ "master" ]
20+
schedule:
21+
- cron: '45 14 * * 3'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
27+
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
28+
permissions:
29+
actions: read
30+
contents: read
31+
security-events: write
32+
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
language: [ 'cpp', 'javascript', 'python', 'ruby' ]
37+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ]
38+
# Use only 'java' to analyze code written in Java, Kotlin or both
39+
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
40+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
41+
42+
steps:
43+
- name: Checkout repository
44+
uses: actions/checkout@v3
45+
46+
# Initializes the CodeQL tools for scanning.
47+
- name: Initialize CodeQL
48+
uses: github/codeql-action/init@v2
49+
with:
50+
languages: ${{ matrix.language }}
51+
# If you wish to specify custom queries, you can do so here or in a config file.
52+
# By default, queries listed here will override any specified in a config file.
53+
# Prefix the list here with "+" to use these queries and those in the config file.
54+
55+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
56+
# queries: security-extended,security-and-quality
57+
58+
59+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
60+
# If this step fails, then you should remove it and run the build manually (see below)
61+
- name: Autobuild
62+
uses: github/codeql-action/autobuild@v2
63+
64+
# ℹ️ Command-line programs to run using the OS shell.
65+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
66+
67+
# If the Autobuild fails above, remove it and uncomment the following three lines.
68+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
69+
70+
# - run: |
71+
# echo "Run, Build Application using script"
72+
# ./location_of_script_within_repo/buildscript.sh
73+
74+
- name: Perform CodeQL Analysis
75+
uses: github/codeql-action/analyze@v2
76+
with:
77+
category: "/language:${{matrix.language}}"

Diff for: CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ project(cmark-gfm)
44
set(PROJECT_VERSION_MAJOR 0)
55
set(PROJECT_VERSION_MINOR 29)
66
set(PROJECT_VERSION_PATCH 0)
7-
set(PROJECT_VERSION_GFM 11)
7+
set(PROJECT_VERSION_GFM 13)
88
set(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}.gfm.${PROJECT_VERSION_GFM})
99

1010
include("FindAsan.cmake")

Diff for: api_test/main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ static void test_continuation_byte(test_batch_runner *runner,
836836

837837
char *html =
838838
cmark_markdown_to_html(buf, strlen(buf), CMARK_OPT_VALIDATE_UTF8);
839-
STR_EQ(runner, html, expected, "invalid utf8 continuation byte %d/%d", pos,
839+
STR_EQ(runner, html, expected, "invalid utf8 continuation byte %zu/%zu", pos,
840840
len);
841841
free(html);
842842
}

Diff for: changelog.txt

+12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
[0.29.0.gfm.13]
2+
* Normalized marker row vs. delimiter row nomenclature (#273)
3+
* Exposed CMARK_NODE_FOOTNOTE_DEFINITION literal value (#336)
4+
* Fix format specifier for printing a size_t (#340)
5+
6+
[0.29.0.gfm.12]
7+
8+
* Fixed polynomial time complexity issues per
9+
https://github.com/github/cmark-gfm/security/advisories/GHSA-w4qg-3vf7-m9x5
10+
* Added CodeQL project integration (#337)
11+
* Addressed const qualifier discard compiler warnings (#330, #331)
12+
113
[0.29.0.gfm.11]
214

315
* Improved fixes for polynomial time complexity issues per

Diff for: extensions/autolink.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ static cmark_node *match(cmark_syntax_extension *ext, cmark_parser *parser,
296296
// inline was finished in inlines.c.
297297
}
298298

299-
static bool validate_protocol(char protocol[], uint8_t *data, size_t rewind, size_t max_rewind) {
299+
static bool validate_protocol(const char protocol[], uint8_t *data, size_t rewind, size_t max_rewind) {
300300
size_t len = strlen(protocol);
301301

302302
if (len > (max_rewind - rewind)) {

0 commit comments

Comments
 (0)