Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/ps
diff options
context:
space:
mode:
authorCarlos 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)
commitb37f798df0c3a745dbc4c1fc8e98b070bcd3ecf3 (patch)
treebdd47191a6d34884e016c936212ee6b125245ced /ps
parentae0bc68145dfe166fed196f05129ea88b22912a6 (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.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ps/ps.c b/ps/ps.c
index 30b9e56..b4b54e0 100644
--- a/ps/ps.c
+++ b/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';