[Debian GNUstep maintainers] Bug#645993: lynkeos.app: error: format not a string literal and no format arguments [-Werror=format-security]

Colin Watson cjwatson at ubuntu.com
Thu Oct 20 11:52:00 UTC 2011


Package: lynkeos.app
Version: 1.2-6
Severity: normal
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch precise

lynkeos.app failed to build from source in the current Ubuntu
development release.  Here's the relevant part of the build log:

  gcc-4.6 ffmpeg_access.c -c \
                -MMD -MP -DFLOAT_PIXELS -DGNUSTEP -DGNUSTEP_BASE_LIBRARY=1 -DGNU_GUI_LIBRARY=1 -DGNU_RUNTIME=1 -DGNUSTEP_BASE_LIBRARY=1 -D_REENTRANT -fPIC -Wall -DGSWARN -DGSDIAGNOSE -Wno-import -g -O2 -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -I. -I/usr/local/include/GNUstep -I/usr/include/GNUstep \
                 -o obj/Lynkeos.obj/ffmpeg_access.c.o
  ffmpeg_access.c: In function 'ffmpegLoadMovie':
  ffmpeg_access.c:233:7: error: format not a string literal and no format arguments [-Werror=format-security]
  ffmpeg_access.c:274:14: warning: assignment from incompatible pointer type [enabled by default]
  ffmpeg_access.c:321:5: warning: implicit declaration of function 'asprintf' [-Wimplicit-function-declaration]
  ffmpeg_access.c: In function 'ffmpegInit':
  ffmpeg_access.c:184:1: warning: control reaches end of non-void function [-Wreturn-type]
  cc1: some warnings being treated as errors

This doesn't currently happen in unstable because lynkeos.app isn't
using the output of dpkg-buildflags
(http://lists.debian.org/debian-devel-announce/2011/09/msg00001.html),
but that will be a problem once you enable this.  Here's a patch to fix
the build under -Werror=format-security.

  * debian/patches/format-security.dpatch: Appease gcc
    -Werror=format-security.

diff -u lynkeos.app-1.2/debian/patches/00list lynkeos.app-1.2/debian/patches/00list
--- lynkeos.app-1.2/debian/patches/00list
+++ lynkeos.app-1.2/debian/patches/00list
@@ -5,0 +6 @@
+format-security
only in patch2:
unchanged:
--- lynkeos.app-1.2.orig/debian/patches/format-security.dpatch
+++ lynkeos.app-1.2/debian/patches/format-security.dpatch
@@ -0,0 +1,19 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## format-security.dpatch by Colin Watson <cjwatson at ubuntu.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Appease gcc -Werror=format-security.
+
+ at DPATCH@
+diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' lynkeos.app-1.2~/Sources/ffmpeg_access.c lynkeos.app-1.2/Sources/ffmpeg_access.c
+--- lynkeos.app-1.2~/Sources/ffmpeg_access.c	2011-10-20 12:47:24.000000000 +0100
++++ lynkeos.app-1.2/Sources/ffmpeg_access.c	2011-10-20 12:47:46.000000000 +0100
+@@ -230,7 +230,7 @@
+     ret = avformat_open_input(&pFormatCtx, movieName, NULL, NULL);
+     if(ret != 0){
+       printf("ERROR: Could not open file ");
+-      printf(movieName);
++      fputs(movieName, stdout);
+       printf("    return : %d \n",ret);
+       //return -1; // Couldn't open file
+       ffmpegSetLastErrorOccured("Couldn't open file.",-1);

Thanks,

-- 
Colin Watson                                       [cjwatson at ubuntu.com]





More information about the pkg-GNUstep-maintainers mailing list