diff options
Diffstat (limited to 'src/plugins/deb_extractor.c')
-rw-r--r-- | src/plugins/deb_extractor.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/deb_extractor.c b/src/plugins/deb_extractor.c index 09a5a8e..b998b36 100644 --- a/src/plugins/deb_extractor.c +++ b/src/plugins/deb_extractor.c | |||
@@ -223,10 +223,15 @@ processControlTar (const char *data, | |||
223 | } | 223 | } |
224 | 224 | ||
225 | #define MAX_CONTROL_SIZE (1024 * 1024) | 225 | #define MAX_CONTROL_SIZE (1024 * 1024) |
226 | #ifndef SIZE_MAX | ||
227 | #define SIZE_MAX ((size_t)-1) | ||
228 | #endif | ||
226 | 229 | ||
227 | static voidpf | 230 | static voidpf |
228 | Emalloc (voidpf opaque, uInt items, uInt size) | 231 | Emalloc (voidpf opaque, uInt items, uInt size) |
229 | { | 232 | { |
233 | if (SIZE_MAX / size <= items) | ||
234 | return NULL; | ||
230 | return malloc (size * items); | 235 | return malloc (size * items); |
231 | } | 236 | } |
232 | 237 | ||