$NetBSD: patch-ac,v 1.1 2006/12/06 14:48:35 wiz Exp $ Fix for CVE-2006-5864. From evince CVS http://cvs.gnome.org/viewcvs/evince/ps/ps.c?r1=1.6&r2=1.6.6.1 --- ps/ps.c.orig 2006-01-07 00:03:44.000000000 +0100 +++ ps/ps.c @@ -1231,7 +1231,8 @@ get_next_text(line, next_char) int level = 0; quoted = 1; line++; - while(*line && !(*line == ')' && level == 0)) { + while(*line && !(*line == ')' && level == 0) + && (cp - text) < PSLINELENGTH - 1) { if(*line == '\\') { if(*(line + 1) == 'n') { *cp++ = '\n'; @@ -1302,7 +1303,8 @@ get_next_text(line, next_char) } } else { - while(*line && !(*line == ' ' || *line == '\t' || *line == '\n')) + while(*line && !(*line == ' ' || *line == '\t' || *line == '\n') + && (cp - text) < PSLINELENGTH - 1) *cp++ = *line++; } *cp = '\0';