Re: Please unblock figlet 2.2.2-1
On Tue, Mar 27, 2007, Carlos Laviola wrote:
> I would be happy to make a new upload backporting these specific
> changes only, provided they don't mind bending the rules a bit in this
> case (which I believe would be harmless).
Nice. Attached is a stripped-down diff to apply to 2.2.1-4.
--
Sam.
diff -puriN orig/figlet-2.2.1/chkfont.c figlet-2.2.1/chkfont.c
--- orig/figlet-2.2.1/chkfont.c 1998-03-06 01:00:00 +0100
+++ figlet-2.2.1/chkfont.c 2007-03-27 14:01:38 +0200
@@ -1,6 +1,7 @@
#include <stdio.h>
#include <string.h>
#include <ctype.h>
+#include <stdlib.h>
#define DATE "20 Feb 1996"
#define VERSION "2.2"
@@ -29,7 +30,7 @@ FILE *fontfile;
char hardblank;
int charheight,upheight,maxlen=0,old_layout;
int spectagcnt;
-char *fileline;
+char *fileline = NULL;
int maxlinelength=0,currline;
int ec,wc;
@@ -68,6 +69,7 @@ char *ptr;
ptr=(char *)malloc(size);
if (ptr==NULL) {
fprintf(stderr,"%s: Out of memory\n",myname);
+ exit(1); /* Bail out now instead of not returning anything */
}
else {
return(ptr);
@@ -106,9 +108,9 @@ exit(1);
void readchar()
{
-int i,expected_width,k,len,newlen,diff,l;
-char endmark,expected_endmark;
-int leadblanks,minleadblanks,trailblanks,mintrailblanks;
+int i,expected_width=0,k,len,newlen,diff,l;
+char endmark,expected_endmark='\0';
+int leadblanks,minleadblanks=0,trailblanks,mintrailblanks=0;
for (i=0;i<charheight;i++) {
fgets(fileline,maxlen+1000,fontfile);
@@ -258,6 +260,7 @@ numsread=sscanf(fileline,"%c %d %d %d %d
&hardblank,&charheight,&upheight,&maxlen,&old_layout,&cmtcount,
&ffrighttoleft,&layout,&spectagcnt);
free(fileline);
+fileline = NULL;
if (numsread<7) {
ffrighttoleft=0;
}
diff -puriN orig/figlet-2.2.1/debian/changelog figlet-2.2.1/debian/changelog
--- orig/figlet-2.2.1/debian/changelog 2007-03-27 14:02:53 +0200
+++ figlet-2.2.1/debian/changelog 2007-03-27 14:01:33 +0200
@@ -1,3 +1,13 @@
+figlet (2.2.1-4.1) unstable; urgency=high
+
+ * Non-maintainer upload.
+ * chkfont.c: backported patch by Kenneth Davies for 2.2.2-1, fix nasty core
+ dumps when attempting to read files that are unexpected. (Closes: #300735)
+ * /usr/bin/figlet is an alternative to /usr/bin/figlet-figlet now. This
+ change was made to pave the way for free figlet clones.
+
+ -- Sam Hocevar (Debian packages) <sam+deb@zoy.org> Tue, 27 Mar 2007 13:51:54 +0200
+
figlet (2.2.1-4) unstable; urgency=high
* debian/control: forgot to change the binary package's Section from misc to
diff -puriN orig/figlet-2.2.1/debian/postinst figlet-2.2.1/debian/postinst
--- orig/figlet-2.2.1/debian/postinst 2007-03-27 14:02:53 +0200
+++ figlet-2.2.1/debian/postinst 2007-03-27 13:59:38 +0200
@@ -1,6 +1,10 @@
#!/bin/sh
-#DEBHELPER#
+if [ "$1" = configure ]; then
+ # Add an alternative for figlet
+ update-alternatives --install /usr/bin/figlet figlet \
+ /usr/bin/figlet-figlet 30
+fi
#DEBHELPER#
diff -puriN orig/figlet-2.2.1/debian/prerm figlet-2.2.1/debian/prerm
--- orig/figlet-2.2.1/debian/prerm 2007-03-27 14:02:53 +0200
+++ figlet-2.2.1/debian/prerm 2007-03-27 13:59:51 +0200
@@ -1,6 +1,9 @@
#!/bin/sh
-#DEBHELPER#
+if [ "$1" = remove ]; then
+ # Remove alternative for figlet
+ update-alternatives --remove figlet /usr/bin/figlet-figlet
+fi
#DEBHELPER#
diff -puriN orig/figlet-2.2.1/debian/rules figlet-2.2.1/debian/rules
--- orig/figlet-2.2.1/debian/rules 2007-03-27 14:02:53 +0200
+++ figlet-2.2.1/debian/rules 2007-03-27 13:59:19 +0200
@@ -45,6 +45,7 @@ install: build
$(MAKE) install DESTDIR=debian/figlet/usr/bin \
DEFAULTFONTDIR=debian/figlet/usr/share/figlet \
MANDIR=debian/trash
+ mv debian/figlet/usr/bin/figlet debian/figlet/usr/bin/figlet-figlet
$(installbin) -d debian/figlet/usr/share/emacs/site-lisp
$(installdoc) debian/figlet.el \
debian/figlet/usr/share/emacs/site-lisp/figlet.el
Reply to: