Files
twx-linux/lib
Eric Biggers a7fbdc8875 509: fix printing uninitialized stack memory when OID is empty
[ Upstream commit 8dfd2f22d3 ]

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: 4f73175d03 ("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>
2018-02-25 11:03:40 +01:00
..
…
…
…
…
…
…
…
…
…
2015-11-23 09:44:58 +01:00
…
…
…
…
…
…
…
…
…
…
…
2015-11-09 15:11:24 -08:00
…
…
…
…
…
…
…
…
…
…
…
…
…
2016-09-24 10:07:43 +02:00
2016-03-03 15:07:24 -08:00
…
…
…
…
…
…
…
…
…
…
…
…
…
2016-10-28 03:01:30 -04:00
…
…
…
…
…