tags 664513 + pending
tags 715917 + pending
thanks

Dear maintainer,

I am about to replace my current NMU in DELAYED with the version
attached to this report, which incorporates two more bug fixes, one trivial
segfault and the other building with hardening options. It is still versioned
as 0.6.4-7.1 and I will upload this version to to DELAYED/8. Please feel free
to tell me if I should delay it longer.

Regards.
Paul
diff -u freesci-0.6.4/debian/rules freesci-0.6.4/debian/rules
--- freesci-0.6.4/debian/rules
+++ freesci-0.6.4/debian/rules
@@ -27,18 +27,11 @@
 VERSION_DEB:=$(shell dpkg-parsechangelog | perl -ne '/^Version: (.*)-(.*?)$$/ 
and print "$$2\n" and last;')
 ME=$(PKG)-$(VERSION_UP)
 
-# handle DEB_BUILD_OPTIONS
-CFLAGS += -Wall -g
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
-  CFLAGS += -O0
-else
-  CFLAGS += -O2
-endif
-export CFLAGS
-export CPPFLAGS
-
-export LDFLAGS += -Wl,--as-needed
-
+DPKG_EXPORT_BUILDFLAGS = 1
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+export DEB_CFLAGS_MAINT_APPEND = -Wall
+export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
+include /usr/share/dpkg/buildflags.mk
 
 TOPDIR:=$(CURDIR)/
 BUILDDIR:=$(CURDIR)/build/
@@ -75,6 +68,8 @@
          patch -p1 < $$PATCH; \
        done
 
+       dh_autotools-dev_updateconfig
+
        touch $(STAMPDIR)/unpack
 
 build: build-arch
diff -u freesci-0.6.4/debian/control freesci-0.6.4/debian/control
--- freesci-0.6.4/debian/control
+++ freesci-0.6.4/debian/control
@@ -3,7 +3,7 @@
 Section: games
 Maintainer: Bas Zoetekouw <[email protected]>
 Standards-Version: 3.8.4
-Build-Depends: debhelper (>= 5.0.51~), libx11-dev, libxext-dev, 
x11proto-core-dev, lesstif2-dev, libncurses5-dev, libpng12-dev, 
libreadline-dev, zlib1g-dev, flex, libasound2-dev, autoconf, automake1.9, 
bison, libdirectfb-dev (>=1), bzip2, libfluidsynth-dev 
+Build-Depends: debhelper (>= 5.0.51~), libx11-dev, libxext-dev, 
x11proto-core-dev, libmotif-dev, libncurses5-dev, libpng-dev, libreadline-dev, 
zlib1g-dev, flex, libasound2-dev, autoconf, automake, bison, libdirectfb-dev 
(>=1), bzip2, libfluidsynth-dev, libxrender-dev, libfontconfig1-dev, 
libice-dev, libxft-dev, autotools-dev, dpkg-dev (>= 1.16.1~)
 Build-Depends-Indep: texlive-latex-base, texlive-latex-recommended, 
texlive-latex-extra, texlive-fonts-recommended
 Homepage: http://freesci.linuxgames.com/
 
diff -u freesci-0.6.4/debian/changelog freesci-0.6.4/debian/changelog
--- freesci-0.6.4/debian/changelog
+++ freesci-0.6.4/debian/changelog
@@ -1,3 +1,23 @@
+freesci (0.6.4-7.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Update Build-Depends
+    - libmotif-dev instead of lesstif2-dev. Unclear where it is used anyways,
+      as no dependency shows up afterwards (Closes: #721928)
+    - add libxrender-dev, libfontconfig1-dev, libice-dev and libxft-dev as they
+      were pulled in by lesstif2-dev and change the build log otherwise
+    - libpng-dev instead of libpng12-dev (Closes: #662336)
+    - automake instead of automake1.9 (Closes: #724370)
+  * Add and use autotools-dev to update config.{guess,sub} during build
+    (Closes: #727860)
+  * Add patch 03_fix_segfault_with_no_x.patch to prevent segfault
+    (Closes: #715917)
+  * Build with hardening (Closes: #664513)
+    - Add 04_fix_format_security.patch
+    - Build-Depends on dpkg-dev (>= 1.16.1~)
+
+ -- Paul Gevers <[email protected]>  Sat, 09 Nov 2013 21:14:04 +0100
+
 freesci (0.6.4-7) unstable; urgency=low
 
   * Fix multiple definition of \ifpdf in docs 
only in patch2:
unchanged:
--- freesci-0.6.4.orig/patches/03_fix_segfault_with_no_x.patch
+++ freesci-0.6.4/patches/03_fix_segfault_with_no_x.patch
@@ -0,0 +1,23 @@
+Description: fix segfault with no X
+ Running freesci with no X or with an empty environment
+ 'env -i /usr/games/freesci' results in a segfault.
+ This patch avoids calling XGetVisualInfo() if display is NULL. 
+Bug-Debian: http://bugs.debian.org/715917
+Author: Graham Inggs <[email protected]>
+Forwarded: No
+Last-Update: 2013-11-08
+--- freesci-0.6.4/src/gfx/drivers/xlib_driver.c
++++ freesci-0.6.4/src/gfx/drivers/xlib_driver.c
+@@ -668,6 +668,12 @@
+                           "PseudoColor", "TrueColor", "DirectColor"};
+
+       printf("Visuals provided by X11 server:\n");
++
++      if (!display) {
++              printf("  None!\n");
++              return;
++      }
++
+       visuals = XGetVisualInfo(display, VisualNoMask, &foo, &visuals_nr);
+
+       if (!visuals_nr) {
only in patch2:
unchanged:
--- freesci-0.6.4.orig/patches/04_fix_format_security.patch
+++ freesci-0.6.4/patches/04_fix_format_security.patch
@@ -0,0 +1,75 @@
+Description: fix format security
+ This patch fixes unsafe uses of fprintf and printf.
+Bug-Debian: http://bugs.debian.org/664513
+Author: Graham Inggs <[email protected]>
+Forwarded: No
+Last-Update: 2013-11-08
+--- freesci-0.6.4/src/engine/kfile.c
++++ freesci-0.6.4/src/engine/kfile.c
+@@ -919,7 +919,7 @@
+
+               if ((idfile = sci_fopen(game_id_file_name, "w"))) {
+
+-                      fprintf(idfile, game_description);
++                      fprintf(idfile, "%s", game_description);
+                       fclose(idfile);
+
+               } else {
+--- freesci-0.6.4/src/tools/sciunpack.c
++++ freesci-0.6.4/src/tools/sciunpack.c
+@@ -223,7 +223,7 @@
+ #endif /* DRAW_GRAPHICS */
+                               ;
+
+-                      printf(gcc_3_0_can_kiss_my_ass);
++                      printf("%s", gcc_3_0_can_kiss_my_ass);
+                       exit(0);
+               }
+
+--- freesci-0.6.4/src/tools/bdf.c
++++ freesci-0.6.4/src/tools/bdf.c
+@@ -3042,14 +3042,14 @@
+         bpr = ((c->bbx.width * font->bpp) + 7) >> 3;
+         for (j = 0; bpr != 0 && j < c->bytes; j++) {
+             if (j && j % bpr == 0)
+-              fprintf(out, eol);
++              fprintf(out, "%s", eol);
+             fprintf(out, "%02X", c->bitmap[j]);
+         }
+         /*
+          * Handle empty bitmaps like this.
+          */
+         if (c->bbx.height > 0)
+-          fprintf(out, eol);
++          fprintf(out, "%s", eol);
+         fprintf(out, "ENDCHAR%s", eol);
+
+         /*
+@@ -3116,14 +3116,14 @@
+         bpr = ((c->bbx.width * font->bpp) + 7) >> 3;
+         for (j = 0; bpr != 0 && j < c->bytes; j++) {
+             if (j && j % bpr == 0)
+-              fprintf(out, eol);
++              fprintf(out, "%s", eol);
+             fprintf(out, "%02X", c->bitmap[j]);
+         }
+         /*
+          * Handle empty bitmaps like this.
+          */
+         if (c->bbx.height > 0)
+-          fprintf(out, eol);
++          fprintf(out, "%s", eol);
+         fprintf(out, "ENDCHAR%s", eol);
+
+         /*
+--- freesci-0.6.4/src/main.c
++++ freesci-0.6.4/src/main.c
+@@ -301,7 +301,7 @@
+               if (i != 0)
+                       printf(", ");
+
+-              printf(gfx_get_driver_name(i));
++              printf("%s", gfx_get_driver_name(i));
+
+               i++;
+       }


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to