diff options
author | Jouni Malinen <j@w1.fi> | 2019-02-09 23:51:51 (GMT) |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2019-02-11 00:35:29 (GMT) |
commit | 62269c8d8d7909bbc6c0f61fd55c6ae52badb164 (patch) | |
tree | 704d4a21c2428ebd9dcec7f04509631614202dd2 /src/tls | |
parent | 3eae9766b7e3aee20f6e6828e1468d244635f451 (diff) | |
download | hostap-62269c8d8d7909bbc6c0f61fd55c6ae52badb164.zip hostap-62269c8d8d7909bbc6c0f61fd55c6ae52badb164.tar.gz hostap-62269c8d8d7909bbc6c0f61fd55c6ae52badb164.tar.bz2 |
TLS: Fix X.509 certificate name conversion into empty string
If none of the supported name attributes are present, the name string
was nul terminated only at the end. Add an explicit nul termination at
the end of the last written (or beginning of the buffer, if nothing is
written) to avoid writing uninitialized data to debug log.
Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/tls')
-rw-r--r-- | src/tls/x509v3.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/tls/x509v3.c b/src/tls/x509v3.c index f80c9a3..fa4d442 100644 --- a/src/tls/x509v3.c +++ b/src/tls/x509v3.c @@ -532,6 +532,8 @@ void x509_name_string(struct x509_name *name, char *buf, size_t len) } done: + if (pos < end) + *pos = '\0'; end[-1] = '\0'; } |