diff options
author | Andreas Steffen <andreas.steffen@strongswan.org> | 2011-01-07 05:28:17 +0100 |
---|---|---|
committer | Andreas Steffen <andreas.steffen@strongswan.org> | 2011-01-07 05:29:59 +0100 |
commit | cfa190bb7c6a641caf81c679ab7042f16c70b555 (patch) | |
tree | b8bafa1ee0aa2cf946ca617a8873afefb4fb3402 | |
parent | fb1e7df13f9b7c338a64a07d8f0882c8da8cb697 (diff) | |
download | strongswan-cfa190bb7c6a641caf81c679ab7042f16c70b555.tar.bz2 strongswan-cfa190bb7c6a641caf81c679ab7042f16c70b555.tar.xz |
compute memory requirement for PEM-encoding correctly
-rw-r--r-- | src/libstrongswan/plugins/pem/pem_encoder.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstrongswan/plugins/pem/pem_encoder.c b/src/libstrongswan/plugins/pem/pem_encoder.c index e255d6fd0..9c8237e4d 100644 --- a/src/libstrongswan/plugins/pem/pem_encoder.c +++ b/src/libstrongswan/plugins/pem/pem_encoder.c @@ -111,7 +111,7 @@ bool pem_encoder_encode(cred_encoding_type_t type, chunk_t *encoding, } /* compute and allocate maximum size of PEM object */ - pem_chars = 4*(asn1.len + 2)/3; + pem_chars = 4 * ((asn1.len + 2) / 3); pem_lines = (asn1.len + BYTES_PER_LINE - 1) / BYTES_PER_LINE; *encoding = chunk_alloc(5 + 2*(6 + strlen(label) + 6) + 3 + pem_chars + pem_lines); pos = encoding->ptr; |