Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: 4f73175 ("X.509: Add utility functions to render OIDs as strings") Signed-off-by: Eric Biggers <[email protected]> Signed-off-by: David Howells <[email protected]>
- Loading branch information