diff options
author | Stefan Walter <stefw@src.gnome.org> | 2007-08-10 19:45:27 +0000 |
---|---|---|
committer | Stefan Walter <stefw@src.gnome.org> | 2007-08-10 19:45:27 +0000 |
commit | cee76d28239350e9a973caa6aaf7b9c1beb8c241 (patch) | |
tree | 0c18504a11488b6102fe346e7d3a3294f037d0fe /pam | |
parent | f2f09b4830a73195cddc82cacad435a5f7050712 (diff) |
Put an upper limit on the amount of data the daemon can send to us.
* pam/gkr-pam-module.c: Put an upper limit on the amount of data
the daemon can send to us.
svn path=/trunk/; revision=774
Diffstat (limited to 'pam')
-rw-r--r-- | pam/gkr-pam-module.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pam/gkr-pam-module.c b/pam/gkr-pam-module.c index 7200d255..b81f1483 100644 --- a/pam/gkr-pam-module.c +++ b/pam/gkr-pam-module.c @@ -137,6 +137,9 @@ foreach_line (char *lines, line_cb cb, void *arg) static char* read_all (int fd) { + /* We only accept a max of 8K from the daemon */ + #define MAX_LENGTH 8192 + char buf[256]; char *ret = NULL; int r, len = 0; @@ -163,7 +166,7 @@ read_all (int fd) strncat (ret, buf, r); } - if (r == 0) + if (r == 0 || len > MAX_LENGTH) break; } |