Package: tuxpuck
Version: 0.8.2-2.1
Severity: minor
Tags: patch
User: [email protected]
Usertags: origin-ubuntu karmic ubuntu-patch
In Ubuntu, we've applied the attached patch to achieve the following:
* utils/anim.c: handle fread() failure, fixes FTBFS (LP: #457214).
We thought you might be interested in doing the same.
Actually, this happens due to -DFORTIFY_SOURCE=2 compiler flag which is
used in Ubuntu by default. It generates a warning (see below) and hence
leads to FTBFS. I could not find any upstream to submit this bug to, so
I'm sending it here. (The fread() result check seems reasonable anyway.)
gcc -g -O2 -D_VERSION=\"0.8.2\" -g -Wall -g -Wall -Werror anim.c `sdl-config
--cflags --libs` -o anim
cc1: warnings being treated as errors
anim.c: In function 'write_file':
anim.c:35: error: ignoring return value of 'fread', declared with attribute
warn_unused_result
make[3]: *** [anim] Error 1
http://launchpadlibrarian.net/32594524/buildlog_ubuntu-karmic-i386.tuxpuck_0.8.2-2.1ubuntu2_FAILEDTOBUILD.txt.gz
-- System Information:
Debian Release: 5.0
APT prefers jaunty-updates
APT policy: (500, 'jaunty-updates'), (500, 'jaunty-security'), (500,
'jaunty-proposed'), (500, 'jaunty-backports'), (500, 'jaunty')
Architecture: i386 (i686)
Kernel: Linux 2.6.28-15-generic (SMP w/2 CPU cores)
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
--- tuxpuck-0.8.2.orig/utils/anim.c
+++ tuxpuck-0.8.2/utils/anim.c
@@ -32,7 +32,8 @@
data = (Uint8 *) malloc(theStat.st_size);
size = theStat.st_size;
fwrite(&size, sizeof(Uint32), 1, out);
- fread(data, theStat.st_size, 1, in);
+ if (fread(data, theStat.st_size, 1, in) != 1)
+ errorcc("Error reading from file, ", filename);
fwrite(data, theStat.st_size, 1, out);
free(data);
fclose(in);