diff options
author | Eric Biggers <ebiggers3@gmail.com> | 2017-12-08 18:13:28 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-02-25 13:01:20 +0300 |
commit | f95b33d6a6194af6ac64360661fdc8d3b387e111 (patch) | |
tree | 8904bac65c22b401921fdc8dba371ac21c036b63 /lib/cpu-notifier-error-inject.c | |
parent | 251efedb4eb21ec4a318c52a824f724947d6d03d (diff) | |
download | linux-f95b33d6a6194af6ac64360661fdc8d3b387e111.tar.xz |
509: fix printing uninitialized stack memory when OID is empty
[ Upstream commit 8dfd2f22d3bf3ab7714f7495ad5d897b8845e8c1 ]
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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/cpu-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions