aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/perl/perl/fixes/CVE-2018-6797-testcase.diff
blob: 5f662dfb5728248d8733ee4f7bf4c3f7ff2cddd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From 0e201824c24919ad8f3570b15b0a3eab40166f8e Mon Sep 17 00:00:00 2001
From: Karl Williamson <khw@cpan.org>
Date: Fri, 2 Feb 2018 15:14:27 -0700
Subject: [PATCH] (perl #132227) restart a node if we change to uni rules
 within the node and encounter a sharp S

This could lead to a buffer overflow.

Test case backported from the corresponding blead fix by Niko Tyni.

Origin: backport
Bug: https://rt.perl.org/Public/Bug/Display.html?id=132227
Patch-Name: fixes/CVE-2018-6797-testcase.diff

---
 t/re/pat_advanced.t | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/t/re/pat_advanced.t b/t/re/pat_advanced.t
index 5e5cc1f..27df550 100644
--- a/t/re/pat_advanced.t
+++ b/t/re/pat_advanced.t
@@ -2336,6 +2336,10 @@ EOF
         unlike("s\N{U+DF}", qr/^\x{00DF}/i, "\"s\\N{U+DF}\", qr/^\\x{00DF}/i");
     }
 
+    {   # Bug #132227, caused failed assertion
+        ok(qr/0b\N{U+41}\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF/i, "No seqgfault [perl #132227]");
+    }
+
     # User-defined Unicode properties to match above-Unicode code points
     sub Is_32_Bit_Super { return "110000\tFFFFFFFF\n" }
     sub Is_Portable_Super { return '!utf8::Any' }   # Matches beyond 32 bits