[server,proxy] check for nullptr before using scard_call_context

* Make smartcard_call_cancel_all_context return FALSE if a NULL context
  is supplied.

* Do not call smartcard_call_context_signal_stop if the context is NULL
This commit is contained in:
Armin Novak
2026-03-02 09:45:27 +01:00
parent d9e1b494d6
commit cc5f1bbb82
3 changed files with 14 additions and 3 deletions

View File

@@ -44,6 +44,13 @@ extern "C"
WINPR_ATTR_NODISCARD
FREERDP_API scard_call_context* smartcard_call_context_new(const rdpSettings* settings);
/** @brief send a stop signal (or reset it if \b reset is \b TRUE) to a \ref scard_call_context
*
* @param ctx The context to send the signal to. Must not be \b nullptr
* @param reset Set or reset the signal
*
* @return \b TRUE for success, \b FALSE otherwise.
*/
FREERDP_API BOOL smartcard_call_context_signal_stop(scard_call_context* ctx, BOOL reset);
WINPR_ATTR_NODISCARD