gnu: Add kafs-client
[jackhill/guix/guix.git] / gnu / packages / patches / ocaml-CVE-2015-8869.patch
1 Adapted from upstream commit 659615c7b100a89eafe6253e7a5b9d84d0e8df74,
2 this patch omits the upstream changes to 'Changes' and 'VERSION'.
3
4 http://seclists.org/oss-sec/2016/q2/170
5 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-8869
6 https://github.com/ocaml/ocaml/commit/659615c7b100a89eafe6253e7a5b9d84d0e8df74
7 ---
8 byterun/alloc.c | 4 ++--
9 byterun/intern.c | 2 +-
10 byterun/str.c | 4 ++--
11 3 files changed, 5 insertions(+), 5 deletions(-)
12
13 diff --git a/byterun/alloc.c b/byterun/alloc.c
14 index 96a21bf..0db9947 100644
15 --- a/byterun/alloc.c
16 +++ b/byterun/alloc.c
17 @@ -153,7 +153,7 @@ CAMLexport int caml_convert_flag_list(value list, int *flags)
18 /* [size] is a [value] representing number of words (fields) */
19 CAMLprim value caml_alloc_dummy(value size)
20 {
21 - mlsize_t wosize = Int_val(size);
22 + mlsize_t wosize = Long_val(size);
23
24 if (wosize == 0) return Atom(0);
25 return caml_alloc (wosize, 0);
26 @@ -169,7 +169,7 @@ CAMLprim value caml_alloc_dummy_function(value size,value arity)
27 /* [size] is a [value] representing number of floats. */
28 CAMLprim value caml_alloc_dummy_float (value size)
29 {
30 - mlsize_t wosize = Int_val(size) * Double_wosize;
31 + mlsize_t wosize = Long_val(size) * Double_wosize;
32
33 if (wosize == 0) return Atom(0);
34 return caml_alloc (wosize, 0);
35 diff --git a/byterun/intern.c b/byterun/intern.c
36 index 89d13d1..7b8d049 100644
37 --- a/byterun/intern.c
38 +++ b/byterun/intern.c
39 @@ -291,7 +291,7 @@ static void intern_rec(value *dest)
40 case OFreshOID:
41 /* Refresh the object ID */
42 /* but do not do it for predefined exception slots */
43 - if (Int_val(Field((value)dest, 1)) >= 0)
44 + if (Long_val(Field((value)dest, 1)) >= 0)
45 caml_set_oo_id((value)dest);
46 /* Pop item and iterate */
47 sp--;
48 diff --git a/byterun/str.c b/byterun/str.c
49 index 5ad4e29..885772f 100644
50 --- a/byterun/str.c
51 +++ b/byterun/str.c
52 @@ -266,7 +266,7 @@ CAMLprim value caml_string_greaterequal(value s1, value s2)
53 CAMLprim value caml_blit_string(value s1, value ofs1, value s2, value ofs2,
54 value n)
55 {
56 - memmove(&Byte(s2, Long_val(ofs2)), &Byte(s1, Long_val(ofs1)), Int_val(n));
57 + memmove(&Byte(s2, Long_val(ofs2)), &Byte(s1, Long_val(ofs1)), Long_val(n));
58 return Val_unit;
59 }
60
61 @@ -278,7 +278,7 @@ CAMLprim value caml_fill_string(value s, value offset, value len, value init)
62
63 CAMLprim value caml_bitvect_test(value bv, value n)
64 {
65 - int pos = Int_val(n);
66 + intnat pos = Long_val(n);
67 return Val_int(Byte_u(bv, pos >> 3) & (1 << (pos & 7)));
68 }
69
70 --
71 2.7.4
72