aboutsummaryrefslogtreecommitdiff
path: root/lang/erlang14
diff options
context:
space:
mode:
authorJimmy Olgeni <olgeni@FreeBSD.org>2009-06-13 10:02:42 +0000
committerJimmy Olgeni <olgeni@FreeBSD.org>2009-06-13 10:02:42 +0000
commit90dfafc410b048d2ba1ca33db98fecfac7b1bc7c (patch)
tree3b89ea14eb48e7ed5f21b7ed4d756e5e2e50c7c5 /lang/erlang14
parentd14a6e684e28f61dca5837cc1238af71cc0dff42 (diff)
downloadports-90dfafc410b048d2ba1ca33db98fecfac7b1bc7c.tar.gz
ports-90dfafc410b048d2ba1ca33db98fecfac7b1bc7c.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>
Notes
Notes: svn path=/head/; revision=235681
Diffstat (limited to 'lang/erlang14')
-rw-r--r--lang/erlang14/Makefile2
-rw-r--r--lang/erlang14/files/patch-lib_erl__interface_src_decode_decode__big.c17
2 files changed, 18 insertions, 1 deletions
diff --git a/lang/erlang14/Makefile b/lang/erlang14/Makefile
index ef61b99bcfa0..0f0287f76df8 100644
--- a/lang/erlang14/Makefile
+++ b/lang/erlang14/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/erlang14/files/patch-lib_erl__interface_src_decode_decode__big.c b/lang/erlang14/files/patch-lib_erl__interface_src_decode_decode__big.c
new file mode 100644
index 000000000000..dd3632543b23
--- /dev/null
+++ b/lang/erlang14/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 */