enscript/enscript-bufpos-crash.patch
Petr Šabata f67354db69 RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/enscript#77586bf6837d2d505f568c4667db6e65b5cd3676
2020-10-15 00:02:55 +02:00

13 lines
571 B
Diff

diff -up enscript-1.6.5.2/src/psgen.c.bufpos-crash enscript-1.6.5.2/src/psgen.c
--- enscript-1.6.5.2/src/psgen.c.bufpos-crash 2013-05-13 16:18:05.119393660 +0100
+++ enscript-1.6.5.2/src/psgen.c 2013-05-13 16:19:17.634739778 +0100
@@ -1928,7 +1928,7 @@ get_next_token (InputStream *is, double
bufpos--;
}
/* Check the octal notations "\\%03o". */
- else if (bufpos - 2 > w
+ else if (bufpos > 2 && bufpos - 2 > w
&& ISOCTAL (buffer[bufpos])
&& ISOCTAL (buffer[bufpos - 1])
&& ISOCTAL (buffer[bufpos - 2])