mirror of
https://gitee.com/openharmony/third_party_cups
synced 2024-11-23 09:59:45 +00:00
10cba4267c
Signed-off-by: cai-zihua <caizihua1@huawei.com>
26 lines
593 B
Diff
26 lines
593 B
Diff
diff --git a/cups/raster-interpret.c b/cups/raster-interpret.c
|
|
index fbe52f37..c24388d2 100644
|
|
--- a/cups/raster-interpret.c
|
|
+++ b/cups/raster-interpret.c
|
|
@@ -1113,7 +1113,19 @@ scan_ps(_cups_ps_stack_t *st, /* I - Stack */
|
|
|
|
cur ++;
|
|
|
|
- if (*cur == 'b')
|
|
+ /*
|
|
+ * Return NULL if we reached NULL terminator, a lone backslash
|
|
+ * is not a valid character in PostScript.
|
|
+ */
|
|
+
|
|
+ if (!*cur)
|
|
+ {
|
|
+ *ptr = NULL;
|
|
+
|
|
+ return (NULL);
|
|
+ }
|
|
+
|
|
+ if (*cur == 'b')
|
|
*valptr++ = '\b';
|
|
else if (*cur == 'f')
|
|
*valptr++ = '\f';
|