95 Commits

Author SHA1 Message Date
Armin Novak
b724ba546d [checks,return] fix various unchecked return values 2026-03-03 09:40:27 +01:00
Armin Novak
9de3eaa037 [server,proxy] add return checks 2026-03-02 18:32:38 +01:00
Armin Novak
e6fca2c021 [winpr,stream] Fix Stream_SetPosition return checks 2026-03-02 11:37:20 +01:00
Armin Novak
5a532269ef [winpr,stream] Check Stream_SetLength return 2026-03-02 11:08:08 +01:00
Armin Novak
fc6f76d23b [server,proxy] expect element to be NULL
channel_stop_and_wait might be called with incompletely allocated
elements. Assume each member of the struct might be NULL
2026-03-02 09:57:03 +01:00
Armin Novak
cc5f1bbb82 [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
2026-03-02 09:45:27 +01:00
Armin Novak
92ab55c5e1 [winpr,stream] Add Stream_ResetPosition
A helper function that does not require return checks, in contrast to
Stream_SetPosition, which might fail.
2026-03-01 06:11:59 +01:00
Armin Novak
e5816d65ce [c23,server] replace NULL with nullptr 2026-02-26 14:34:11 +01:00
Armin Novak
e58819830a [c23] simplify boolean checks 2026-02-26 11:51:05 +01:00
Armin Novak
48267edf2f [winpr] add WINPR_C_ARRAY_INIT
since C23 allows c++ style initializing replace direct use with this
macro
2026-02-25 19:23:08 +01:00
Armin Novak
3fcc287b16 [warnings] initialize all va_list 2026-02-25 07:41:39 +01:00
akallabeth
6598081863 Merge pull request #12326 from akallabeth/server-attr-nodiscard
[server] add WINPR_ATTR_NODISCARD macro
2026-02-24 11:16:27 +01:00
akallabeth
b2f325251a [server] add WINPR_ATTR_NODISCARD macro 2026-02-24 11:03:46 +01:00
Armin Novak
e6172762aa [server,proxy] use default threadpool
Do not create a threadpool per smartcard channel instance. This is
overkill and does not really improve performance, just wastes resources.
2026-02-20 11:02:34 +01:00
Armin Novak
9d199a9735 [freerdp,server] mark function pointers [[nodiscard]] 2026-02-16 09:18:35 +01:00
Armin Novak
371da1cd2f [clang,warnings] fix Wjump-misses-init 2026-01-08 11:32:43 +01:00
Armin Novak
54f419c1b7 [clang,warnings] fix Wjump-misses-init 2026-01-08 11:32:43 +01:00
akallabeth
919a569d56 [server,proxy] eliminate unused variable 2025-09-12 09:59:56 +02:00
Armin Novak
2d7bf81397 [proxy,channels] better NULL checks 2025-09-04 10:54:30 +02:00
akallabeth
343d270c5a [proxy,channels] fix unused parameter warning 2025-09-01 09:18:48 +02:00
akallabeth
2dd38aaeef [proxy,channels] drop drdynvc packets not tracked
When receiving dynamic channel packets that do not belong to an open
channel drop the packet.
2025-08-25 16:26:51 +02:00
akallabeth
dc463e1fcd [proxy,channels] refactor dynamic channel
* Split DynvcTrackerPeekFn into smaller fragments each handling one kind
  of packet
* Unify logging with a custom logger function to have unified log
  entries with appropriate data logged.
2025-08-25 15:54:19 +02:00
akallabeth
896c8dbd75 [proxy,channels] improve drdynvc logging
* Split functions to make them more readable
* Improve logging details
2025-08-22 09:06:37 +02:00
akallabeth
65f18983ed [warnings] Fix format string errors
* Fix casts of format string arguments (%p requires void*)
* Fix format string to match type of arguments
2025-08-13 15:09:48 +02:00
akallabeth
1fe0ca41e1 [warnings] fix missing integer casts 2025-03-11 13:20:19 +01:00
akallabeth
8bd7814e9a [server,proxy] Log MinorFunction in smartcard channel 2025-03-05 23:48:56 +01:00
akallabeth
150b61d4c2 [proxy,warnings] fix -Wunused-parameter 2025-02-13 15:53:58 +01:00
akallabeth
4df9e30604 [proxy,channels] fix return values and sign conversions 2025-02-13 15:35:15 +01:00
akallabeth
26eac974fe [warnings] fix integer casting
* use WINPR_ASSERTING_INT_CAST where possible
 * fix a few inconsistencies
2024-12-19 12:33:42 +01:00
akallabeth
faae38120c [cmake,format] reformat all cmake files 2024-11-27 20:41:48 +01:00
stephanebill
4f2afa8c47 spell check with codespell 2024-11-20 16:53:40 -05:00
akallabeth
78acedb40e [warnigns] fix Wshorten-64-to-32 2024-11-11 10:22:37 +01:00
akallabeth
997ff57301 [proxy,rdpdr] fix integer narrow 2024-10-03 18:58:53 +02:00
akallabeth
490ca0453b [winpr,stream] use Stream_BufferAs instead of casting 2024-10-01 10:34:42 +02:00
akallabeth
a19305569d [assert] fix ULONG_MAX use
most of the time this was used to check ULONG limits. Replace with
correct UINT32_MAX
2024-09-16 08:22:40 +02:00
akallabeth
f1be630637 [server,proxy] fix unchecked return 2024-09-15 09:07:49 +02:00
akallabeth
3820858c63 [server,proxy] discard closed dyn channel data
If a dynamic channel does no longer exist or has been closed discard the
channel data received from client
2024-07-25 12:02:51 +02:00
akallabeth
d7ebec5a65 [tidy] move loop variable declaration to loop 2024-02-22 12:31:50 +01:00
akallabeth
0e44b2c674 [clang-tidy] clang-analyzer-unix.Malloc 2024-02-15 11:49:16 +01:00
akallabeth
81d2c1f057 [clang-tidy] clang-analyzer-core.NullDereference 2024-02-15 11:49:16 +01:00
akallabeth
0ba995655d [clang-tidy] cppcoreguidelines-init-variables 2024-02-15 11:49:16 +01:00
akallabeth
207def5c56 [clang-tidy] readability-isolate-declaration 2024-02-15 11:49:16 +01:00
akallabeth
bb42d425ed [gcc,clang] add support for attribute(malloc)
Mark all malloc like functions and add their appropriate free function
to let the compiler complain on mismatches
2024-02-02 15:10:40 +01:00
Armin Novak
c0df9a50e5 [proxy,drdynvc] fix #9303 broken format string 2023-08-21 10:42:33 +02:00
ehdgks0627
d04ba8d6ef Correct typos and formatting errors in format strings
In several files, fixed typos in format strings that were causing unexpected output and formatting issues.
2023-07-28 15:34:46 +02:00
Armin Novak
e61880d077 [standard] replace __FUNCTION__ with __func__ 2023-07-27 20:02:43 +02:00
akallabeth
be7ff37069 [proxy,rdpdr] fix boroken logger calls 2023-06-29 21:06:47 +02:00
akallabeth
2ac8946950 [proxy,channels] drdynvc logging context
* Use a dynamic logger for dynamic proxy channel
* Set logger context for dynamic channel
2023-06-29 14:30:09 +02:00
akallabeth
ead2be382c [proxy,channels] use logger context for rdpdr 2023-06-29 14:30:09 +02:00
Armin Novak
133585cd5e [proxy,drdynvc] remove dynamic channels on open
dynamic channels can be opened at any time during a session. If we
receive a CREATE_REQUEST_PDU and the channel id is already in use, print
out a warning with the existing channel details and discard it before
creating the newly requested channel.
2023-06-29 11:05:37 +02:00