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