commonmarker 0.16.5 → 0.16.6

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: 095c88f0b8335861ecd1f2fd3036eb38e3ba15e5
4
- data.tar.gz: 523409323276c59e1da4efda9c08d846b512f599
3
+ metadata.gz: 1c6cd6cd50f6bdf18dc0107cd9201924ad1d8427
4
+ data.tar.gz: 3a23e9ac4f92a454b57b1599df3935d41f0c6cc7
5
5
  SHA512:
6
- metadata.gz: 0bc5a2a5d1193c8beb136e392db2fdb1f323e0b87f73aa4e2a54eb0ebc8240518a0151852e82b64ed2e8469e4786f41b8b166162cd0b929e38e6e385c5b6c8b2
7
- data.tar.gz: 7bd29b88abaaacc24e05fa03bbfccffb9e703d0f57ec0efe903aa502bd7db3efdb6ef8e4682cdb36f58f04828e763f5f988a82f42f02c125fcd6e0f9e8ec01ee
6
+ metadata.gz: cda57d46d1f05d1ed4eec74507dd0a676688f3cabfa498e88a6a9f7f19c4cb508925cf338cc6545b9e3be9af897efda9c087e1215abc44928d60ab2bc72347fa
7
+ data.tar.gz: 4273d4afbf96a6b3f040a68ab30f50b503504fa48f2aee0a0124f0e4dc18141d24411ba2c507f93a671561bf0d363f0c96ccf106f80253ae6562b080bc71b733
@@ -19,7 +19,7 @@ set(PROJECT_NAME "cmark")
19
19
  set(PROJECT_VERSION_MAJOR 0)
20
20
  set(PROJECT_VERSION_MINOR 27)
21
21
  set(PROJECT_VERSION_PATCH 1)
22
- set(PROJECT_VERSION_GFM 2)
22
+ set(PROJECT_VERSION_GFM 3)
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,8 @@
1
+ [0.27.1.gfm.3]
2
+
3
+ * Various undefined behavior issues fixed (#38, #39, #40).
4
+ * Tag filter is case-insensitive (#43).
5
+
1
6
  [0.27.1.gfm.2]
2
7
 
3
8
  * Fix a number of bugs (reading past end of buffer, undefined behavior.
@@ -1,5 +1,6 @@
1
1
  #include "tagfilter.h"
2
2
  #include <parser.h>
3
+ #include <ctype.h>
3
4
 
4
5
  static const char *blacklist[] = {
5
6
  "title", "textarea", "style", "xmp", "iframe",
@@ -23,7 +24,7 @@ static int is_tag(const unsigned char *tag_data, size_t tag_size,
23
24
  if (*tagname == 0)
24
25
  break;
25
26
 
26
- if (tag_data[i] != *tagname)
27
+ if (tolower(tag_data[i]) != *tagname)
27
28
  return 0;
28
29
  }
29
30
 
@@ -62,6 +62,12 @@ static void *arena_calloc(size_t nmem, size_t size) {
62
62
  init_arena();
63
63
 
64
64
  size_t sz = nmem * size + sizeof(size_t);
65
+
66
+ // Round allocation sizes to largest integer size to
67
+ // ensure returned memory is correctly aligned
68
+ const size_t align = sizeof(size_t) - 1;
69
+ sz = (sz + align) & ~align;
70
+
65
71
  if (sz > A->sz) {
66
72
  A->prev = alloc_arena_chunk(sz, A->prev);
67
73
  return (uint8_t *) A->prev->ptr + sizeof(size_t);
@@ -71,8 +77,7 @@ static void *arena_calloc(size_t nmem, size_t size) {
71
77
  }
72
78
  void *ptr = (uint8_t *) A->ptr + A->used;
73
79
  A->used += sz;
74
- size_t new_sz = nmem * size;
75
- memcpy(ptr, &new_sz, sizeof(new_sz));
80
+ *((size_t *) ptr) = sz - sizeof(size_t);
76
81
  return (uint8_t *) ptr + sizeof(size_t);
77
82
  }
78
83
 
@@ -95,7 +95,7 @@ static int shortest_unused_backtick_sequence(const char *code) {
95
95
  current++;
96
96
  } else {
97
97
  if (current > 0 && current < 32) {
98
- used |= (1 << current);
98
+ used |= (1U << current);
99
99
  }
100
100
  current = 0;
101
101
  }
@@ -106,7 +106,8 @@ static cmark_chunk chunk_clone(cmark_mem *mem, cmark_chunk *src) {
106
106
  c.len = len;
107
107
  c.data = (unsigned char *)mem->calloc(len + 1, 1);
108
108
  c.alloc = 1;
109
- memcpy(c.data, src->data, len);
109
+ if (len)
110
+ memcpy(c.data, src->data, len);
110
111
  c.data[len] = '\0';
111
112
 
112
113
  return c;
@@ -9285,12 +9285,12 @@ All other HTML tags are left untouched.
9285
9285
  <strong> <title> <style> <em>
9286
9286
 
9287
9287
  <blockquote>
9288
- <xmp> is disallowed.
9288
+ <xmp> is disallowed. <XMP> is also disallowed.
9289
9289
  </blockquote>
9290
9290
  .
9291
9291
  <p><strong> &lt;title> &lt;style> <em></p>
9292
9292
  <blockquote>
9293
- &lt;xmp> is disallowed.
9293
+ &lt;xmp> is disallowed. &lt;XMP> is also disallowed.
9294
9294
  </blockquote>
9295
9295
  ````````````````````````````````
9296
9296
 
@@ -37,3 +37,5 @@ RUN wget https://cmake.org/files/v3.8/cmake-3.8.2.tar.gz && \
37
37
  make install && \
38
38
  cd .. && \
39
39
  rm -rf cmake-*
40
+
41
+ RUN apt-get update && apt-get install -y ninja-build
@@ -108,7 +108,7 @@ module CommonMarker
108
108
  noembed|noframes|script|plaintext
109
109
  )
110
110
  (?=\s|>|/>)
111
- }x,
111
+ }xi,
112
112
  '&lt;\1')
113
113
  else
114
114
  str
@@ -1,3 +1,3 @@
1
1
  module CommonMarker
2
- VERSION = '0.16.5'.freeze
2
+ VERSION = '0.16.6'.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.16.5
4
+ version: 0.16.6
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-06-30 00:00:00.000000000 Z
12
+ date: 2017-07-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ruby-enum