summaryrefslogtreecommitdiff
path: root/src/depend
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2012-07-22 05:33:09 +0000
committerrubidium <rubidium@openttd.org>2012-07-22 05:33:09 +0000
commit990c9f8a7f4371e59218f7c08a905cf9b3acd708 (patch)
treebed36df0976cc13f591d6fdc0d451c421a2c2324 /src/depend
parent3202b09b120fa499be404047f95fe2cfb275e3cc (diff)
downloadopenttd-990c9f8a7f4371e59218f7c08a905cf9b3acd708.tar.xz
(svn r24429) -Change: add some hardening flags to the compiler for release builds
Diffstat (limited to 'src/depend')
-rw-r--r--src/depend/depend.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/depend/depend.cpp b/src/depend/depend.cpp
index 67ceec25f..4d5ef35f3 100644
--- a/src/depend/depend.cpp
+++ b/src/depend/depend.cpp
@@ -910,7 +910,10 @@ int main(int argc, char *argv[])
size = ftell(src);
rewind(src);
content = (char*)malloc(size * sizeof(*content));
- fread(content, 1, size, src);
+ if (fread(content, 1, size, src) != (size_t)size) {
+ fprintf(stderr, "Could not read %s\n", filename);
+ exit(-2);
+ }
fclose(src);
}