diff options
-rw-r--r-- | base/sbcp.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/base/sbcp.c b/base/sbcp.c index 979ae0992..47fc233ec 100644 --- a/base/sbcp.c +++ b/base/sbcp.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* Copyright (C) 2001-2021 Artifex Software, Inc. | 1 | /* Copyright (C) 2001-2023 Artifex Software, Inc. |
2 | All Rights Reserved. | 2 | All Rights Reserved. |
3 | 3 | ||
4 | This software is provided AS-IS with no warranty, either express or | 4 | This software is provided AS-IS with no warranty, either express or |
@@ -50,6 +50,14 @@ s_xBCPE_process(stream_state * st, stream_cursor_read * pr, | |||
50 | byte ch = *++p; | 50 | byte ch = *++p; |
51 | 51 | ||
52 | if (ch <= 31 && escaped[ch]) { | 52 | if (ch <= 31 && escaped[ch]) { |
53 | /* Make sure we have space to store two characters in the write buffer, | ||
54 | * if we don't then exit without consuming the input character, we'll process | ||
55 | * that on the next time round. | ||
56 | */ | ||
57 | if (pw->limit - q < 2) { | ||
58 | p--; | ||
59 | break; | ||
60 | } | ||
53 | if (p == rlimit) { | 61 | if (p == rlimit) { |
54 | p--; | 62 | p--; |
55 | break; | 63 | break; |