From 1f5782739a395cff085b9d246eb47b866fee1f22 Mon Sep 17 00:00:00 2001 From: John Zaitseff Date: Tue, 1 Jan 2008 02:53:21 +0200 Subject: [PATCH] dselect: Do not loop endlessly with very long package descriptions Closes: #179320, #342495 --- ChangeLog | 5 +++++ debian/changelog | 3 +++ dselect/baselist.cc | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index 66b0a163..03596482 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-01-01 John Zaitseff + + * dselect/baselist.cc (baselist::wordwrapinfo): Stop processing when + exceeding infopad line limit, and add a warning message. + 2008-01-01 Sven Rudolph * dselect/baselist.cc (baselist::startdisplay): Set helpscreen_attr diff --git a/debian/changelog b/debian/changelog index 1af4204d..ffd368a1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,6 +15,9 @@ dpkg (1.14.15) UNRELEASED; urgency=low * Do not disaplay garbage in dselect on monochrome terminals, by setting a missing ncurses character attribute. Closes: #155741, #157093 Thanks to Sven Rudolph. + * Do not loop endlessly in dselect with very long package descriptions. + Closes: #179320, #342495 + Thanks to John Zaitseff. [ Updated dpkg translations ] * Norwegian Bokmål (Hans Fredrik Nordhaug). Closes: #457918 diff --git a/dselect/baselist.cc b/dselect/baselist.cc index fd6bcdc6..8ba7ff02 100644 --- a/dselect/baselist.cc +++ b/dselect/baselist.cc @@ -365,6 +365,11 @@ void baselist::wordwrapinfo(int offset, const char *m) { wrapping= 1; } if (!p) break; + if (getcury(infopad) == (MAX_DISPLAY_INFO - 1)) { + waddstr(infopad, + "[The package description is too long and has been truncated...]"); + break; + } m= ++p; } if (debug) fprintf(debug,"baselist[%p]::wordwrapinfo() done\n",this); -- 2.39.5