diff options
author | Björn Gustavsson <[email protected]> | 2013-02-07 13:15:15 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2013-02-07 13:15:15 +0100 |
commit | f7eed05cb052fd479efaa7607118bf74b523ec33 (patch) | |
tree | 72b8ec5e4ae350b52fb58c75613b0d19ab7611e7 /lib/asn1/c_src | |
parent | 2ec63b31743a177446884ed12736607d3fbea1ef (diff) | |
parent | d45c6b727da8db7664d2cc08a16ef8ca68fe46df (diff) | |
download | otp-f7eed05cb052fd479efaa7607118bf74b523ec33.tar.gz otp-f7eed05cb052fd479efaa7607118bf74b523ec33.tar.bz2 otp-f7eed05cb052fd479efaa7607118bf74b523ec33.zip |
Merge branch 'maint'
* maint:
Prepare release
Don't run testX420/1 on old slow Sparc systems
testX420: Pass Options to the ASN.1 compiler
asn1_erl_nif: Correct broken length encoding
asn1_SUITE: Mend broken test_modified_x420/1
Revert "Prepare release"
Conflicts:
lib/asn1/doc/src/notes.xml
lib/asn1/test/asn1_SUITE.erl
Diffstat (limited to 'lib/asn1/c_src')
-rw-r--r-- | lib/asn1/c_src/asn1_erl_nif.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/asn1/c_src/asn1_erl_nif.c b/lib/asn1/c_src/asn1_erl_nif.c index e7e5f5f2f5..b3dd312fed 100644 --- a/lib/asn1/c_src/asn1_erl_nif.c +++ b/lib/asn1/c_src/asn1_erl_nif.c @@ -1130,8 +1130,8 @@ int ber_encode_length(size_t size, mem_chunk_t **curr, unsigned int *count) { (*curr)->curr -= 1; (*count)++; } else { - int chunks = size / 256 + 1; - if (ber_check_memory(curr, chunks + 1)) + int chunks = 0; + if (ber_check_memory(curr, 8)) return ASN1_ERROR; while (size > 0) @@ -1140,6 +1140,7 @@ int ber_encode_length(size_t size, mem_chunk_t **curr, unsigned int *count) { size >>= 8; (*curr)->curr -= 1; (*count)++; + chunks++; } *(*curr)->curr = chunks | 0x80; |