]> mj.ucw.cz Git - moe.git/commitdiff
Isolate: Added missing typecast of memory limit to rlim_t
authorMartin Mares <mj@ucw.cz>
Thu, 18 Jun 2015 14:51:03 +0000 (16:51 +0200)
committerMartin Mares <mj@ucw.cz>
Thu, 18 Jun 2015 14:51:03 +0000 (16:51 +0200)
Memory limits greater than 2GB were misapplied on some platforms.

isolate/isolate.c

index 4fc6d05d0a7a9d4d74fe2f42fb92904011331f7f..cb33c603ab5e1ca0cd1bd91781b412679c983684 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *     A Process Isolator based on Linux Containers
  *
- *     (c) 2012-2014 Martin Mares <mj@ucw.cz>
+ *     (c) 2012-2015 Martin Mares <mj@ucw.cz>
  *     (c) 2012-2014 Bernard Blackham <bernard@blackham.com.au>
  */
 
@@ -1231,7 +1231,7 @@ setup_rlimits(void)
 #define RLIM(res, val) setup_rlim("RLIMIT_" #res, RLIMIT_##res, val)
 
   if (memory_limit)
-    RLIM(AS, memory_limit * 1024);
+    RLIM(AS, (rlim_t)memory_limit * 1024);
 
   RLIM(STACK, (stack_limit ? (rlim_t)stack_limit * 1024 : RLIM_INFINITY));
   RLIM(NOFILE, 64);