From 50caa77ee5098dd6d3f7410f610a756bb5dac72f 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. --- assuan/ChangeLog | 5 +++++ assuan/assuan-buffer.c | 3 +++ 2 files changed, 8 insertions(+) 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) { -- 2.26.2