[opentyrian] 04/06: check-return-values.patch
Etienne Millon
emillon-guest at moszumanska.debian.org
Mon Jan 5 15:09:03 UTC 2015
This is an automated email from the git hooks/post-receive script.
emillon-guest pushed a commit to branch master
in repository opentyrian.
commit 8ed31353ff22561bd4c04760aba912fa2b2ed0a8
Author: Etienne Millon <me at emillon.org>
Date: Mon Jan 5 15:29:38 2015 +0100
check-return-values.patch
---
debian/patches/check-return-values.patch | 19 +++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 20 insertions(+)
diff --git a/debian/patches/check-return-values.patch b/debian/patches/check-return-values.patch
new file mode 100644
index 0000000..7772e94
--- /dev/null
+++ b/debian/patches/check-return-values.patch
@@ -0,0 +1,19 @@
+--- a/src/lvllib.c
++++ b/src/lvllib.c
+@@ -29,10 +29,13 @@
+ {
+ FILE *f = dir_fopen_die(data_dir(), levelFile, "rb");
+
+- efread(&lvlNum, sizeof(JE_word), 1, f);
++ int res = efread(&lvlNum, sizeof(JE_word), 1, f);
++ assert(res == 1);
+
+- for (int x = 0; x < lvlNum; x++)
+- efread(&lvlPos[x], sizeof(JE_longint), 1, f);
++ for (int x = 0; x < lvlNum; x++) {
++ res = efread(&lvlPos[x], sizeof(JE_longint), 1, f);
++ assert(res == 1);
++ }
+
+ lvlPos[lvlNum] = ftell_eof(f);
+
diff --git a/debian/patches/series b/debian/patches/series
index f4c6455..b178c2d 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
data_dir.patch
uninitialized-vars.patch
cppflags.patch
+check-return-values.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/opentyrian.git
More information about the Pkg-games-commits
mailing list