summaryrefslogtreecommitdiff
path: root/core/include/fxcrt/fx_basic.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/include/fxcrt/fx_basic.h')
-rw-r--r--core/include/fxcrt/fx_basic.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/core/include/fxcrt/fx_basic.h b/core/include/fxcrt/fx_basic.h
index 378d6c30a8..bdb1599491 100644
--- a/core/include/fxcrt/fx_basic.h
+++ b/core/include/fxcrt/fx_basic.h
@@ -6,6 +6,10 @@
#ifndef _FX_BASIC_H_
#define _FX_BASIC_H_
+#ifndef _STDINT_H_
+#define _STDINT_H_
+#include <stdint.h>
+#endif
#ifndef _FX_SYSTEM_H_
#include "fx_system.h"
#endif
@@ -18,6 +22,7 @@
#ifndef _FX_STREAM_H_
#include "fx_stream.h"
#endif
+
class CFX_BinaryBuf : public CFX_Object
{
public:
@@ -776,6 +781,9 @@ public:
if (data_size > FixedSize) {
m_pData = FX_Allocator_Alloc(m_pAllocator, DataType, data_size);
} else {
+ if (FixedSize > SIZE_MAX/sizeof(DataType))
+ return;
+
FXSYS_memset32(m_Data, 0, sizeof(DataType)*FixedSize);
}
}
@@ -788,6 +796,10 @@ public:
if (data_size > FixedSize) {
m_pData = FX_Allocator_Alloc(m_pAllocator, DataType, data_size);
} else {
+
+ if (FixedSize > SIZE_MAX/sizeof(DataType))
+ return;
+
FXSYS_memset32(m_Data, 0, sizeof(DataType)*FixedSize);
}
}