aboutsummaryrefslogtreecommitdiffstats
path: root/lang/erlang
diff options
context:
space:
mode:
authorolgeni <olgeni@FreeBSD.org>2009-06-13 18:02:42 +0800
committerolgeni <olgeni@FreeBSD.org>2009-06-13 18:02:42 +0800
commit3c1d5d95d8706f225148c3d9fae060a470bac469 (patch)
tree20a12f94a1fd06e7f55e1c6af582369681b8ad0b /lang/erlang
parentbd7fd82b12fedae032a010482cc74e69b052dcb0 (diff)
downloadfreebsd-ports-gnome-3c1d5d95d8706f225148c3d9fae060a470bac469.tar.gz
freebsd-ports-gnome-3c1d5d95d8706f225148c3d9fae060a470bac469.tar.zst
freebsd-ports-gnome-3c1d5d95d8706f225148c3d9fae060a470bac469.zip
Add bugfix for ei_decode_big.
"The high order bits of the 16-bits digit (short) are read, even if the byte (at u[(i*2)+1]) doesn't belong to the big. In other words, big numbers such as 16#1234567890 with an odd number of bytes are decoded with a garbage byte (i.e. 16#XX1234567890)." http://erlang.org/pipermail/erlang-bugs/2008-October/001023.html Obtained from: Paul Guyot <pguyot at kallisys.net>
Diffstat (limited to 'lang/erlang')
-rw-r--r--lang/erlang/Makefile2
-rw-r--r--lang/erlang/files/patch-lib_erl__interface_src_decode_decode__big.c17
2 files changed, 18 insertions, 1 deletions
diff --git a/lang/erlang/Makefile b/lang/erlang/Makefile
index ef61b99bcfa0..0f0287f76df8 100644
--- a/lang/erlang/Makefile
+++ b/lang/erlang/Makefile
@@ -7,7 +7,7 @@
PORTNAME= erlang
PORTVERSION= r13b01
-PORTREVISION= 3
+PORTREVISION= 4
PORTEPOCH= 1
CATEGORIES= lang parallel java
MASTER_SITES= http://www.erlang.org/download/ \
diff --git a/lang/erlang/files/patch-lib_erl__interface_src_decode_decode__big.c b/lang/erlang/files/patch-lib_erl__interface_src_decode_decode__big.c
new file mode 100644
index 000000000000..dd3632543b23
--- /dev/null
+++ b/lang/erlang/files/patch-lib_erl__interface_src_decode_decode__big.c
@@ -0,0 +1,17 @@
+
+$FreeBSD$
+
+--- lib/erl_interface/src/decode/decode_big.c.orig
++++ lib/erl_interface/src/decode/decode_big.c
+@@ -52,7 +52,10 @@
+ u = (unsigned char *) s;
+ for (i = 0; i < b->arity; ++i) {
+ dt[i] = u[i*2];
+- dt[i] |= ((unsigned short) u[(i*2)+1]) << 8;
++ if ((i*2 + 1) < digit_bytes)
++ {
++ dt[i] |= ((unsigned short) u[(i*2)+1]) << 8;
++ }
+ }
+ } else {
+ s++; /* skip sign byte */