diff options
author | michi_cc <michi_cc@openttd.org> | 2011-09-02 20:54:51 +0000 |
---|---|---|
committer | michi_cc <michi_cc@openttd.org> | 2011-09-02 20:54:51 +0000 |
commit | f227e90c248b37fe50c9e48a08a1bb976c782e9f (patch) | |
tree | 08d88d27ff581ebc89f0f16acb35d156ad6a84be /src/stdafx.h | |
parent | 65637d89411e96dee5ee9fc2e8a7b3805c4162a2 (diff) | |
download | openttd-f227e90c248b37fe50c9e48a08a1bb976c782e9f.tar.xz |
(svn r22875) -Codechange: Add some asserts and checks to better prevent overflow of the argument to malloc. (monoid)
Diffstat (limited to 'src/stdafx.h')
-rw-r--r-- | src/stdafx.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/stdafx.h b/src/stdafx.h index 4d61cf8b5..c50a93eba 100644 --- a/src/stdafx.h +++ b/src/stdafx.h @@ -63,6 +63,10 @@ #include <climits> #include <cassert> +#ifndef SIZE_MAX + #define SIZE_MAX ((size_t)-1) +#endif + #if defined(UNIX) || defined(__MINGW32__) #include <sys/types.h> #endif |