commonmarker 0.17.1 → 0.17.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of commonmarker might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fd465d3c630c43a890eee8ec949fccf4eabb5997
4
- data.tar.gz: e9932c4d91ef3479c9635276a634ce1da089b4b3
3
+ metadata.gz: 49c0fe604d16fddab739a15eb88155c8e8258554
4
+ data.tar.gz: a6347c38e4659f38adea70964d62b6d31941f635
5
5
  SHA512:
6
- metadata.gz: 58d1456c8e6da1b8b7288303570acbe467daf61402965fca54f0bc2f9f4c922a4edc19c7be25743b702b8a7fd0b0911742935498918e9044ebedeb89fd5cdcb3
7
- data.tar.gz: 0c9d4f55d0326a1bf9830aea8f98b917c2f4fd3ea828bdfbebfdb2dd9063841b538d61228d7ae3ac7dc02b411d6562029d89e78f3a260090e3023c0238bd75d9
6
+ metadata.gz: 5668901959312c78aabe85779d9d06ae9bafe500477122f02d851ed28a77588eb3eead6a83286db29161905aed6feb4f36f22ed8f797deb4dec8eaa68043a6cc
7
+ data.tar.gz: 731052d3a802465eadd8473558d0a6a5b941252d74db531be6e9487f88ed7374e957170967f340e30916eb642fb322c5a11fa8fd03dc056f0b64e05302d497a5
@@ -19,7 +19,7 @@ set(PROJECT_NAME "cmark")
19
19
  set(PROJECT_VERSION_MAJOR 0)
20
20
  set(PROJECT_VERSION_MINOR 28)
21
21
  set(PROJECT_VERSION_PATCH 0)
22
- set(PROJECT_VERSION_GFM 9)
22
+ set(PROJECT_VERSION_GFM 10)
23
23
  set(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}.gfm.${PROJECT_VERSION_GFM} )
24
24
 
25
25
  option(CMARK_TESTS "Build cmark tests and enable testing" ON)
@@ -1,3 +1,7 @@
1
+ [0.28.0.gfm.10]
2
+
3
+ * Fix denial of service parsing references.
4
+
1
5
  [0.28.0.gfm.9]
2
6
 
3
7
  * Fix denial of service parsing nested links (#49).
@@ -281,17 +281,21 @@ static cmark_node *finalize(cmark_parser *parser, cmark_node *b) {
281
281
 
282
282
  switch (S_type(b)) {
283
283
  case CMARK_NODE_PARAGRAPH:
284
- while (cmark_strbuf_at(node_content, 0) == '[' &&
285
- (pos = cmark_parse_reference_inline(parser->mem, node_content,
286
- parser->refmap))) {
284
+ {
285
+ cmark_chunk chunk = {node_content->ptr, node_content->size, 0};
286
+ while (chunk.len && chunk.data[0] == '[' &&
287
+ (pos = cmark_parse_reference_inline(parser->mem, &chunk, parser->refmap))) {
287
288
 
288
- cmark_strbuf_drop(node_content, pos);
289
+ chunk.data += pos;
290
+ chunk.len -= pos;
289
291
  }
292
+ cmark_strbuf_drop(node_content, (node_content->size - chunk.len));
290
293
  if (is_blank(node_content, 0)) {
291
294
  // remove blank node (former reference def)
292
295
  cmark_node_free(b);
293
296
  }
294
297
  break;
298
+ }
295
299
 
296
300
  case CMARK_NODE_CODE_BLOCK:
297
301
  if (!b->as.code.fenced) { // indented code
@@ -70,7 +70,7 @@ static delimiter *S_insert_emph(subject *subj, delimiter *opener,
70
70
  static int parse_inline(cmark_parser *parser, subject *subj, cmark_node *parent, int options);
71
71
 
72
72
  static void subject_from_buf(cmark_mem *mem, int line_number, int block_offset, subject *e,
73
- cmark_strbuf *buffer, cmark_reference_map *refmap);
73
+ cmark_chunk *buffer, cmark_reference_map *refmap);
74
74
  static bufsize_t subject_find_special_char(subject *subj, int options);
75
75
 
76
76
  // Create an inline with a literal string value.
@@ -157,12 +157,10 @@ static CMARK_INLINE cmark_node *make_autolink(subject *subj,
157
157
  }
158
158
 
159
159
  static void subject_from_buf(cmark_mem *mem, int line_number, int block_offset, subject *e,
160
- cmark_strbuf *buffer, cmark_reference_map *refmap) {
160
+ cmark_chunk *chunk, cmark_reference_map *refmap) {
161
161
  int i;
162
162
  e->mem = mem;
163
- e->input.data = buffer->ptr;
164
- e->input.len = buffer->size;
165
- e->input.alloc = 0;
163
+ e->input = *chunk;
166
164
  e->line = line_number;
167
165
  e->pos = 0;
168
166
  e->block_offset = block_offset;
@@ -1322,7 +1320,8 @@ void cmark_parse_inlines(cmark_parser *parser,
1322
1320
  cmark_reference_map *refmap,
1323
1321
  int options) {
1324
1322
  subject subj;
1325
- subject_from_buf(parser->mem, parent->start_line, parent->start_column - 1 + parent->internal_offset, &subj, &parent->content, refmap);
1323
+ cmark_chunk content = {parent->content.ptr, parent->content.size, 0};
1324
+ subject_from_buf(parser->mem, parent->start_line, parent->start_column - 1 + parent->internal_offset, &subj, &content, refmap);
1326
1325
  cmark_chunk_rtrim(&subj.input);
1327
1326
 
1328
1327
  while (!is_eof(&subj) && parse_inline(parser, &subj, parent, options))
@@ -1350,7 +1349,7 @@ static void spnl(subject *subj) {
1350
1349
  // Modify refmap if a reference is encountered.
1351
1350
  // Return 0 if no reference found, otherwise position of subject
1352
1351
  // after reference is parsed.
1353
- bufsize_t cmark_parse_reference_inline(cmark_mem *mem, cmark_strbuf *input,
1352
+ bufsize_t cmark_parse_reference_inline(cmark_mem *mem, cmark_chunk *input,
1354
1353
  cmark_reference_map *refmap) {
1355
1354
  subject subj;
1356
1355
 
@@ -16,7 +16,7 @@ void cmark_parse_inlines(cmark_parser *parser,
16
16
  cmark_reference_map *refmap,
17
17
  int options);
18
18
 
19
- bufsize_t cmark_parse_reference_inline(cmark_mem *mem, cmark_strbuf *input,
19
+ bufsize_t cmark_parse_reference_inline(cmark_mem *mem, cmark_chunk *input,
20
20
  cmark_reference_map *refmap);
21
21
 
22
22
  void cmark_inlines_add_special_character(unsigned char c, bool emphasis);
@@ -1,3 +1,3 @@
1
1
  module CommonMarker
2
- VERSION = '0.17.1'.freeze
2
+ VERSION = '0.17.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: commonmarker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.1
4
+ version: 0.17.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-09-06 00:00:00.000000000 Z
12
+ date: 2017-09-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ruby-enum