From e71b873f193234c0ad23d442cbeb0c68fbc0215b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Thu, 25 Mar 2010 22:53:51 +0000 Subject: [PATCH] * html_to_ascii(): don't buffer underrun while checking whether we should append a trailing newline or not. --- libcitadel/lib/html_to_ascii.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcitadel/lib/html_to_ascii.c b/libcitadel/lib/html_to_ascii.c index 90d1103f5..86cbdedee 100644 --- a/libcitadel/lib/html_to_ascii.c +++ b/libcitadel/lib/html_to_ascii.c @@ -570,7 +570,7 @@ char *html_to_ascii(char *inputmsg, int msglen, int screenwidth, int do_citaform --output_len; } - if (outptr[output_len-1] != '\n') { + if ((output_len > 0) && (outptr[output_len-1] != '\n')) { strcat(outptr, "\n"); ++output_len; } -- 2.39.2