Skip to content

Commit fb78693

Browse files
committed
qgs: protect against format strings in QL log messages
The sgx_proc_log_report() method takes a format string and var-args. It is unsafe to accept a non-const string from the QL library and pass it to sgx_proc_log_report(), as the log message may contain format strings from user data. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
1 parent 7bc0560 commit fb78693

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

QuoteGeneration/quote_wrapper/qgs/qgs_ql_logic.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ typedef quote3_error_t (*sgx_ql_set_logging_callback_t)(sgx_ql_logging_callback_
5050

5151
void sgx_ql_logging_callback(sgx_ql_log_level_t level, const char *message) {
5252
if (level == SGX_QL_LOG_ERROR) {
53-
sgx_proc_log_report(1, message);
53+
sgx_proc_log_report(1, "%s", message);
5454

5555
} else if (level == SGX_QL_LOG_INFO) {
56-
sgx_proc_log_report(3, message);
56+
sgx_proc_log_report(3, "%s", message);
5757
}
5858
}
5959

0 commit comments

Comments
 (0)