Added
Link Here
|
0 |
- |
1 |
--- base/sbcp.c |
|
|
2 |
+++ base/sbcp.c |
3 |
@@ -1,4 +1,4 @@ |
4 |
-/* Copyright (C) 2001-2021 Artifex Software, Inc. |
5 |
+/* Copyright (C) 2001-2023 Artifex Software, Inc. |
6 |
All Rights Reserved. |
7 |
|
8 |
This software is provided AS-IS with no warranty, either express or |
9 |
@@ -50,6 +50,14 @@ s_xBCPE_process(stream_state * st, stream_cursor_read * pr, |
10 |
byte ch = *++p; |
11 |
|
12 |
if (ch <= 31 && escaped[ch]) { |
13 |
+ /* Make sure we have space to store two characters in the write buffer, |
14 |
+ * if we don't then exit without consuming the input character, we'll process |
15 |
+ * that on the next time round. |
16 |
+ */ |
17 |
+ if (pw->limit - q < 2) { |
18 |
+ p--; |
19 |
+ break; |
20 |
+ } |
21 |
if (p == rlimit) { |
22 |
p--; |
23 |
break; |