$OpenBSD: patch-kghostview_kgv_miniwidget_cpp,v 1.1 2002/09/28 22:50:30 brad Exp $
--- kghostview/kgv_miniwidget.cpp.orig	Mon Mar 18 07:42:36 2002
+++ kghostview/kgv_miniwidget.cpp	Sat Sep 28 18:12:33 2002
@@ -1146,7 +1146,8 @@ bool KGVMiniWidget::psCopyDoc( const QSt
 	    free( comment );
 	    continue;
 	}
-	sscanf( comment + length("%%Pages:" ), "%s", text );
+	sscanf( comment + length("%%Pages:" ), "%256s", text );
+	text[256] = 0; // Just in case of an overflow
 	if( strcmp( text, "(atend)" ) == 0 ) {
 	    fputs( comment, to );
 	    pages_atend = true;
