From 164490e4129cd56f6e3f54bb64970047092efe9f Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Tue, 8 Jun 2004 17:48:37 +0000 Subject: [PATCH] 2004-06-08 Marcus Brinkmann * assuan-buffer.c (assuan_write_line): If the line is longer than the maximum line length, bail out early. --- trunk/assuan/ChangeLog | 5 +++++ trunk/assuan/assuan-buffer.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/trunk/assuan/ChangeLog b/trunk/assuan/ChangeLog index 5354743..92d4b3a 100644 --- a/trunk/assuan/ChangeLog +++ b/trunk/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/trunk/assuan/assuan-buffer.c b/trunk/assuan/assuan-buffer.c index 59518f2..01e7700 100644 --- a/trunk/assuan/assuan-buffer.c +++ b/trunk/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) { -- 2.26.2