diff options
author | Yves-Alexis Perez <corsac@debian.org> | 2014-03-11 20:48:48 +0100 |
---|---|---|
committer | Yves-Alexis Perez <corsac@debian.org> | 2014-03-11 20:48:48 +0100 |
commit | 15fb7904f4431a6e7c305fd08732458f7f885e7e (patch) | |
tree | c93b60ee813af70509f00f34e29ebec311762427 /src/libstrongswan/utils/identification.c | |
parent | 5313d2d78ca150515f7f5eb39801c100690b6b29 (diff) | |
download | vyos-strongswan-15fb7904f4431a6e7c305fd08732458f7f885e7e.tar.gz vyos-strongswan-15fb7904f4431a6e7c305fd08732458f7f885e7e.zip |
Imported Upstream version 5.1.2
Diffstat (limited to 'src/libstrongswan/utils/identification.c')
-rw-r--r-- | src/libstrongswan/utils/identification.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libstrongswan/utils/identification.c b/src/libstrongswan/utils/identification.c index 9c43ad570..e7eb63bc6 100644 --- a/src/libstrongswan/utils/identification.c +++ b/src/libstrongswan/utils/identification.c @@ -332,8 +332,13 @@ static void dntoa(chunk_t dn, char *buf, size_t len) buf += written; len -= written; + written = 0; chunk_printable(data, &printable, '?'); - written = snprintf(buf, len, "%.*s", (int)printable.len, printable.ptr); + if (printable.ptr) + { + written = snprintf(buf, len, "%.*s", (int)printable.len, + printable.ptr); + } chunk_free(&printable); if (written < 0 || written >= len) { |