diff options
author | Carlos Garcia Campos <carlosgc@gnome.org> | 2006-11-30 13:36:33 (GMT) |
---|---|---|
committer | Carlos Garcia Campos <carlosgc@src.gnome.org> | 2006-11-30 13:36:33 (GMT) |
commit | b37f798df0c3a745dbc4c1fc8e98b070bcd3ecf3 (patch) | |
tree | bdd47191a6d34884e016c936212ee6b125245ced /ps | |
parent | ae0bc68145dfe166fed196f05129ea88b22912a6 (diff) |
Fix CVE-2006-5864.
2006-11-30 Carlos Garcia Campos <carlosgc@gnome.org>
* ps/ps.c: (get_next_text):
Fix CVE-2006-5864.
Diffstat (limited to 'ps')
-rw-r--r-- | ps/ps.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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'; |