gv/gv-3.5.8-sec2.patch

29 lines
699 B
Diff

--- source/ps.c
+++ source/ps.c 2006-11-09 17:37:07.000000000 +0000
@@ -1423,6 +1423,10 @@
quoted=1;
line++;
while (*line && !(*line == ')' && level == 0 )) {
+ if (cp - text >= PSLINELENGTH - 2) {
+ ENDMESSAGE(gettext)
+ return NULL;
+ }
if (*line == '\\') {
if (*(line+1) == 'n') {
*cp++ = '\n';
@@ -1477,8 +1481,13 @@
}
}
} else {
- while (*line && !(*line == ' ' || *line == '\t' || *line == '\n'))
+ while (*line && !(*line == ' ' || *line == '\t' || *line == '\n')) {
+ if (cp - text >= PSLINELENGTH - 2) {
+ ENDMESSAGE(gettext)
+ return NULL;
+ }
*cp++ = *line++;
+ }
}
*cp = '\0';
if (next_char) *next_char = line;