diff options
author | Eric Biggers <ebiggers3@gmail.com> | 2017-12-08 16:13:28 +0100 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2017-12-08 16:13:28 +0100 |
commit | 8dfd2f22d3bf3ab7714f7495ad5d897b8845e8c1 (patch) | |
tree | c937db5e51b0f6404d53cb4044e83b8071a8cc51 /crypto/asymmetric_keys/pkcs7_parser.c | |
parent | X.509: fix buffer overflow detection in sprint_oid() (diff) | |
download | linux-8dfd2f22d3bf3ab7714f7495ad5d897b8845e8c1.tar.xz linux-8dfd2f22d3bf3ab7714f7495ad5d897b8845e8c1.zip |
509: fix printing uninitialized stack memory when OID is empty
Callers of sprint_oid() do not check its return value before printing
the result. In the case where the OID is zero-length, -EBADMSG was
being returned without anything being written to the buffer, resulting
in uninitialized stack memory being printed. Fix this by writing
"(bad)" to the buffer in the cases where -EBADMSG is returned.
Fixes: 4f73175d0375 ("X.509: Add utility functions to render OIDs as strings")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions