trace: fix out-of-bound memory access
authorDr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Wed, 20 Mar 2019 23:56:36 +0000 (00:56 +0100)
committerDr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Fri, 29 Mar 2019 22:59:46 +0000 (23:59 +0100)
commit6a411436a5642a4c2ca934a649eced7118f3793d
tree393cd93cd7f4d95e8bf9ba6688a1d7790c03386b
parent0fda9f7c291de7b3a1e576ce43801dfa91b42f0e
trace: fix out-of-bound memory access

When OSSL_trace_get_category_num() is called with an unknown category
name, it returns -1. This case needs to be considered in order to
avoid out-of-bound memory access to the `trace_channels` array.

Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/8552)
crypto/trace.c