archrelease: copy trunk to extra-x86_64
[arch-packages.git] / unison / trunk / large.patch
blob6dcef5265b999a984cec5f68843c4bbac2e671a0
1 diff -Nrua /usr/ports/net/unison/patches/patch-bytearray_stubs_c ./patches/patch-bytearray_stubs_c
2 --- /usr/ports/net/unison/patches/patch-bytearray_stubs_c Thu Jan 1 01:00:00 1970
3 +++ ./patches/patch-bytearray_stubs_c Tue Jan 17 08:44:39 2017
4 @@ -0,0 +1,45 @@
5 +Fix rare SIGSEGV when transferring large replicas.
6 +Fix a theoretical integer overflow.
8 +Patches from here:
9 +https://caml.inria.fr/mantis/view.php?id=7431#c17026
10 +and here:
11 +https://caml.inria.fr/mantis/view.php?id=7431#c16962
13 +Related issue reports:
14 +https://github.com/bcpierce00/unison/issues/48
15 +https://caml.inria.fr/mantis/view.php?id=7431
16 +https://bugzilla.redhat.com/show_bug.cgi?id=1401759
18 +Thanks to Alex Markley and OCaml developers
19 +--- bytearray_stubs.c.orig Tue Jan 17 08:41:00 2017
20 ++++ bytearray_stubs.c Tue Jan 17 08:41:21 2017
21 +@@ -5,6 +5,7 @@
23 + #include "caml/intext.h"
24 + #include "caml/bigarray.h"
25 ++#include "caml/memory.h"
27 + CAMLprim value ml_marshal_to_bigarray(value v, value flags)
28 + {
29 +@@ -21,15 +22,18 @@ CAMLprim value ml_marshal_to_bigarray(value v, value f
31 + CAMLprim value ml_unmarshal_from_bigarray(value b, value ofs)
32 + {
33 ++ CAMLparam1(b); /* Holds [b] live until unmarshalling completes. */
34 ++ value result;
35 + struct caml_bigarray *b_arr = Bigarray_val(b);
36 +- return input_value_from_block (Array_data (b_arr, ofs),
37 ++ result = input_value_from_block (Array_data (b_arr, ofs),
38 + b_arr->dim[0] - Long_val(ofs));
39 ++ CAMLreturn(result);
40 + }
42 + CAMLprim value ml_blit_string_to_bigarray
43 + (value s, value i, value a, value j, value l)
44 + {
45 +- char *src = String_val(s) + Int_val(i);
46 ++ char *src = String_val(s) + Long_val(i);
47 + char *dest = Array_data(Bigarray_val(a), j);
48 + memcpy(dest, src, Long_val(l));
49 + return Val_unit;