aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libstrongswan/utils/identification.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libstrongswan/utils/identification.c b/src/libstrongswan/utils/identification.c
index 8c2f4f3c8..673cbb828 100644
--- a/src/libstrongswan/utils/identification.c
+++ b/src/libstrongswan/utils/identification.c
@@ -963,7 +963,10 @@ static identification_t *clone_(private_identification_t *this)
private_identification_t *clone = identification_create();
clone->type = this->type;
- clone->encoded = chunk_clone(this->encoded);
+ if (this->encoded.len)
+ {
+ clone->encoded = chunk_clone(this->encoded);
+ }
clone->public.equals = this->public.equals;
clone->public.matches = this->public.matches;