nokogiri 1.13.8 → 1.13.9

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

Potentially problematic release.


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

@@ -1,61 +0,0 @@
1
- From 3ea8d08da310b645e37940eaae5cc28e251b155b Mon Sep 17 00:00:00 2001
2
- From: Mike Dalessio <mike.dalessio@gmail.com>
3
- Date: Sat, 17 Jul 2021 14:36:53 -0400
4
- Subject: [PATCH] htmlParseComment: handle abruptly-closed comments
5
-
6
- See guidance provided on abrutply-closed comments here:
7
-
8
- https://html.spec.whatwg.org/multipage/parsing.html#parse-error-abrupt-closing-of-empty-comment
9
- ---
10
- HTMLparser.c | 11 +++++++++++
11
- include/libxml/xmlerror.h | 1 +
12
- 2 files changed, 12 insertions(+)
13
-
14
- diff --git a/HTMLparser.c b/HTMLparser.c
15
- index b56363a..f0bf294 100644
16
- --- a/HTMLparser.c
17
- +++ b/HTMLparser.c
18
- @@ -3485,10 +3485,20 @@ htmlParseComment(htmlParserCtxtPtr ctxt) {
19
- q = CUR_CHAR(ql);
20
- if (q == 0)
21
- goto unfinished;
22
- + if (q == '>') {
23
- + htmlParseErr(ctxt, XML_ERR_COMMENT_ABRUPTLY_ENDED, "Comment abruptly ended", NULL, NULL);
24
- + cur = '>';
25
- + goto finished;
26
- + }
27
- NEXTL(ql);
28
- r = CUR_CHAR(rl);
29
- if (r == 0)
30
- goto unfinished;
31
- + if (q == '-' && r == '>') {
32
- + htmlParseErr(ctxt, XML_ERR_COMMENT_ABRUPTLY_ENDED, "Comment abruptly ended", NULL, NULL);
33
- + cur = '>';
34
- + goto finished;
35
- + }
36
- NEXTL(rl);
37
- cur = CUR_CHAR(l);
38
- while ((cur != 0) &&
39
- @@ -3536,6 +3546,7 @@ htmlParseComment(htmlParserCtxtPtr ctxt) {
40
- cur = next;
41
- l = nl;
42
- }
43
- +finished:
44
- buf[len] = 0;
45
- if (cur == '>') {
46
- NEXT;
47
- diff --git a/include/libxml/xmlerror.h b/include/libxml/xmlerror.h
48
- index c101997..7b68e40 100644
49
- --- a/include/libxml/xmlerror.h
50
- +++ b/include/libxml/xmlerror.h
51
- @@ -209,6 +209,7 @@ typedef enum {
52
- XML_ERR_VERSION_MISMATCH, /* 109 */
53
- XML_ERR_NAME_TOO_LONG, /* 110 */
54
- XML_ERR_USER_STOP, /* 111 */
55
- + XML_ERR_COMMENT_ABRUPTLY_ENDED, /* 112 */
56
- XML_NS_ERR_XML_NAMESPACE = 200,
57
- XML_NS_ERR_UNDEFINED_NAMESPACE, /* 201 */
58
- XML_NS_ERR_QNAME, /* 202 */
59
- --
60
- 2.31.0
61
-
Binary file
Binary file