CVE-2015-8869
authorMehdi Dogguy <mehdi@debian.org>
Wed, 21 Dec 2016 23:45:00 +0000 (00:45 +0100)
committerMehdi Dogguy <mehdi@debian.org>
Wed, 21 Dec 2016 23:48:59 +0000 (23:48 +0000)
Upstream commit: https://github.com/ocaml/ocaml/commit/659615c7b100a89eafe6253e7a5b9d84d0e8df74#diff-a97df53e3ebc59bb457191b496c90762

http://www.openwall.com/lists/oss-security/2016/04/29/1

Gbp-Pq: Name 0015-CVE-2015-8869.patch

byterun/alloc.c
byterun/intern.c
byterun/str.c

index b421cace621a00da19fcc7cb05d8f5b512764f72..3d7dfc42de9bbeb69a4f0dab74ea426d7d2c5223 100644 (file)
@@ -147,7 +147,7 @@ CAMLexport int caml_convert_flag_list(value list, int *flags)
 
 CAMLprim value caml_alloc_dummy(value size)
 {
-  mlsize_t wosize = Int_val(size);
+  mlsize_t wosize = Long_val(size);
 
   if (wosize == 0) return Atom(0);
   return caml_alloc (wosize, 0);
@@ -161,7 +161,7 @@ CAMLprim value caml_alloc_dummy_function(value size,value arity)
 
 CAMLprim value caml_alloc_dummy_float (value size)
 {
-  mlsize_t wosize = Int_val(size) * Double_wosize;
+  mlsize_t wosize = Long_val(size) * Double_wosize;
 
   if (wosize == 0) return Atom(0);
   return caml_alloc (wosize, 0);
index d2943afb845b9adea2cceb8d4e9002f50a7c165c..e5cdeb4613f90cbc94043644f0b9f43097a5e666 100644 (file)
@@ -287,7 +287,7 @@ static void intern_rec(value *dest)
   case OFreshOID:
     /* Refresh the object ID */
     /* but do not do it for predefined exception slots */
-    if (Int_val(Field((value)dest, 1)) >= 0)
+    if (Long_val(Field((value)dest, 1)) >= 0)
       caml_set_oo_id((value)dest);
     /* Pop item and iterate */
     sp--;
index a72b34c4e405005c3b207747a0e16026c66d88e3..dc69624c1b9fa6252fe34fbd76091056da4e8979 100644 (file)
@@ -266,7 +266,7 @@ CAMLprim value caml_string_greaterequal(value s1, value s2)
 CAMLprim value caml_blit_string(value s1, value ofs1, value s2, value ofs2,
                                 value n)
 {
-  memmove(&Byte(s2, Long_val(ofs2)), &Byte(s1, Long_val(ofs1)), Int_val(n));
+  memmove(&Byte(s2, Long_val(ofs2)), &Byte(s1, Long_val(ofs1)), Long_val(n));
   return Val_unit;
 }
 
@@ -293,7 +293,7 @@ CAMLprim value caml_is_printable(value chr)
 
 CAMLprim value caml_bitvect_test(value bv, value n)
 {
-  int pos = Int_val(n);
+  intnat pos = Long_val(n);
   return Val_int(Byte_u(bv, pos >> 3) & (1 << (pos & 7)));
 }