From: Marcus Brinkmann Date: Tue, 8 Jun 2004 17:48:37 +0000 (+0000) Subject: 2004-06-08 Marcus Brinkmann X-Git-Tag: gpgme-0-9-0~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=50caa77ee5098dd6d3f7410f610a756bb5dac72f;p=gpgme.git 2004-06-08 Marcus Brinkmann * assuan-buffer.c (assuan_write_line): If the line is longer than the maximum line length, bail out early. --- diff --git a/assuan/ChangeLog b/assuan/ChangeLog index 5354743..92d4b3a 100644 --- a/assuan/ChangeLog +++ b/assuan/ChangeLog @@ -1,3 +1,8 @@ +2004-06-08 Marcus Brinkmann + + * assuan-buffer.c (assuan_write_line): If the line is longer than + the maximum line length, bail out early. + 2004-04-19 Werner Koch * assuan-socket-connect.c: Include sys/types.h diff --git a/assuan/assuan-buffer.c b/assuan/assuan-buffer.c index 59518f2..01e7700 100644 --- a/assuan/assuan-buffer.c +++ b/assuan/assuan-buffer.c @@ -238,6 +238,9 @@ assuan_write_line (ASSUAN_CONTEXT ctx, const char *line) s = strchr (line, '\n'); len = s? (s-line) : strlen (line); + if (len > LINELENGTH - 2) + return ASSUAN_Line_Too_Long; + /* fixme: we should do some kind of line buffering. */ if (ctx->log_fp) {