Commit Graph

65 Commits

Author SHA1 Message Date
akallabeth 581c9f1798 [channels,parallel] clean up code 2024-04-12 12:41:42 +02:00
akallabeth d7ebec5a65 [tidy] move loop variable declaration to loop 2024-02-22 12:31:50 +01:00
akallabeth 0ba995655d [clang-tidy] cppcoreguidelines-init-variables 2024-02-15 11:49:16 +01:00
akallabeth bb5345c60e [freerdp,api] add FREERDP_ENTRY_POINT
C requires prototypes or compilers will complain about them missing. Our
library entry points do not have such, therefore add the macro
FREERDP_ENTRY_POINT which declares the function prototype automatically
before the function.
2023-08-25 14:36:05 +02:00
Armin Novak 970f0c54e8 [stream] use const correct Stream_Pointer access 2023-06-08 08:09:33 +02:00
Armin Novak a4c6b36a19 [build] fix memory sanitizer stack frame warnings 2023-06-07 09:14:45 +02:00
akallabeth a5b42f0f84 [includes] untangled circular includes 2023-03-15 08:22:23 +01:00
akallabeth 82ba9ede9c [freerdp] use FREERDP_/UWAC_/RDTK_ prefix for conditional headers 2023-01-10 17:38:00 +01:00
Armin Novak a57c480b29 [channel,rdpdr] proper queue cleanup for rdpdr 2022-12-02 15:08:09 +01:00
akallabeth 5799fb2018 Replace ConvertFromUnicode and ConvertToUnicode
* Use new ConvertUtf8ToWChar, ConvertUtf8NToWChar,
  ConvertUtf8ToWCharAlloc and ConvertUtf8NToWCharAlloc
* Use new ConvertWCharToUtf8, ConvertWCharNToUtf8,
  ConvertWCharToUtf8Alloc and ConvertWCharNToUtf8Alloc
* Use new Stream UTF16 to/from UTF8 read/write functions
* Use new settings UTF16 to/from UTF8 read/write functions
2022-11-28 10:42:36 +01:00
akallabeth 26ac2f0b27
Additional checks (#8279)
* Fix length checks in parallel driver

The length requested was not checked against the length read from
the port.

* Fixed missing length check in video channel

Data received in video redirection channel was not checked for
proper length.

* Fixed video presentation reference counter

Video channel presentation reference counter was not updated with
Video_Frame_new. A failing H264 decoding step could trigger a reference
decrement and the presentation was freed by accident.
Also clean up the increment and decrement of presentation

* Fixed tsmf ffmpeg context extra data size checks

tsmf_ffmpeg_init_stream did not abort if the video format ExtraDataSize
was not sufficiently large to satisfy expectations.

* Fixed missing input data length check

tsmf_ifman_exchange_capability_request did not check if the input
data stream actually contained the amount of bytes requested to
copy.

* Fixed TSMF tsmf_ffmpeg_set_format length checks

ExtraDataSize of format was not checked for expected minimum length

* Fixed TSMF tsmf_read_format_type length checks

ExtraDataSize of format was not checked for expected minimum
length

* Fixed TSMF tsmf_gstreamer_set_format length checks

ExtraDataSize of format was not checked for expected minimum
length
2022-10-06 15:30:54 +02:00
akallabeth 1dcc5a180a Fixed warnings 2022-04-28 11:24:51 +02:00
akallabeth 73cdcdfe09
Logging and parser fixes (#7796)
* Fixed remdesk settings pointer

* Fixed sign warnings in display_write_monitor_layout_pdu

* Use freerdp_abort_connect_context and freerdp_shall_disconnect_context

* Added and updates settings

* info assert/dynamic timezone

* mcs assert/log/flags

* Fixed and added assertions for wStream

* Unified stream length checks

* Added new function to check for lenght and log
* Replace all usages with this new function

* Cleaned up PER, added parser logging

* Cleaned up BER, added parser logging

* log messages

* Modified Stream_CheckAndLogRequiredLengthEx

* Allow custom format and options
* Add Stream_CheckAndLogRequiredLengthExVa for prepared va_list

* Improved Stream_CheckAndLogRequiredLength

* Now have log level adjustable
* Added function equivalents for existing logger
* Added a backtrace in case of a failure is detected

* Fixed public API input checks
2022-04-19 14:29:17 +02:00
Armin Novak 4d03d7c0bf Freerdp remove #ifdef HAVE_CONFIG_H 2022-03-03 11:26:48 +01:00
Armin Novak b2ad47a809 Reorganized FreeRDP headers 2022-03-03 11:26:48 +01:00
Armin Novak fd027d1bf0 Removed BUILTIN_CHANNELS
Building client channels out of tree does not work reliable as the
dependencies can not be easily split. (exceptions may be simple ones
as echo channel)
It does complicate the build system and code though, so remove this
for maintainability reasons.
2022-02-23 10:43:46 +01:00
akallabeth 8cc6582044
Unify struct definitions (#7633)
* Unified enum/struct definitions, fixed include issues

* Fixed mac compilation issues

* Added missing include

* Fixed windows server build warnings

* Fixed VS2010 build issue

* Removed unnecessary library linking

* Fixed ThreadPool WinXP compatibility

* Fixed pr review remarks
2022-02-14 14:59:22 +01:00
Armin Novak 7d80c74e97 Cleaned up RDPDR channel interhitance
* All channels inheriting from RDPDR_DRIVE base struct
* Add functions to create/free a new device of a type
* Fixed settings array resize code, prevent 0 sizes
2021-10-18 09:21:02 +02:00
akallabeth 795842f409 Fixed oob read in parallel_process_irp_create 2020-05-06 13:31:57 +02:00
akallabeth 6efa8290d8 Fixed oob read in parallel_process_irp_read 2020-05-06 13:31:57 +02:00
akallabeth 917daa8b56 Fixed oob read in parallel_process_irp_write 2020-05-06 13:31:57 +02:00
Armin Novak 72ca88f49c Reformatted to new style 2019-11-07 10:53:54 +01:00
Armin Novak 2517755d25 Fixed thread function return and parameters. 2018-03-07 14:36:55 +01:00
Armin Novak d823586c3e Fixed parallel channel argument checks 2017-12-21 15:16:24 +01:00
Norbert Federa f71b6b46e8 fix string format specifiers
- fixed invalid, missing or additional arguments
- removed all type casts from arguments
- added missing (void*) typecasts for %p arguments
- use inttypes defines where appropriate
2016-12-16 13:48:43 +01:00
Norbert Federa c6e6b44143 countless WLog/printf format specifier fixes 2016-11-25 17:06:25 +01:00
Marc-André Moreau dee76617d9 channels: remove thread-local storage usage 2016-11-15 11:41:01 -05:00
Armin Novak 9f5da483dc Reformatted files touched in last 2 commits. 2016-10-06 13:43:12 +02:00
Armin Novak 88a3b8dd76 Initializing channel context in each thread. 2016-10-06 13:43:12 +02:00
Norbert Federa 90cdfa7646 cmake: replaced STATIC_CHANNELS with BUILTIN_CHANNELS 2016-06-15 13:36:27 +02:00
Armin Novak 5acd80dd5b Exporting channel entry points. 2016-02-29 15:18:19 +01:00
Martin Haimberger 52405a3e79 Remove WIN32ERROR type
All return values are UINT now.
2015-08-27 05:38:20 -07:00
Martin Haimberger 65fd259610 misc fixes:
fixed all bugs from the review
checking all WaitFor*Object/s calls
2015-07-30 06:49:21 -07:00
Martin Haimberger b8c110d19b introduced channel error reporting system
The rdpContext gets an event which will
get set if an error occoured in a channel.

If a thread or a void callback has to report an
error it will get signaled by this system.
2015-07-15 00:50:35 -07:00
Martin Haimberger 6e4e1c2773 Merge remote-tracking branch 'upstream/master' into mh-stream-fix
Conflicts:
	client/Windows/wf_cliprdr.c
2015-06-18 03:06:40 -07:00
Martin Haimberger 3cc0148577 channel parallel hardend 2015-06-18 03:04:32 -07:00
David FORT 12f873f1f9 Fixed MessageQueue and callers 2015-05-29 14:24:14 +02:00
Hardening f8120919af Add checks for some XXX_New and XXX_Add functions
Based on PR #2616
2015-05-18 11:28:00 +02:00
Marc-André Moreau 53639dea0b channels: reduce dependency on svc_plugin.h 2014-06-11 15:09:28 -04:00
Marc-André Moreau 00e6463e1e channels/rdpdr: robustness improvements 2014-03-26 11:05:12 -04:00
Armin Novak 8d6f49c01a Using new API for message queue. 2013-11-12 15:18:35 +01:00
Armin Novak a3c319c973 Fixed coverity issue 1047567 2013-09-05 12:14:33 +02:00
Armin Novak 1d2adcbe26 Fixed resource leaks. 2013-08-14 13:23:54 +02:00
Marc-André Moreau fdf3ddcf9e freerdp: purge deprecated stream utils 2013-05-08 17:48:30 -04:00
Marc-André Moreau fd230443c5 freerdp: purge old stream utils 2013-05-08 16:27:21 -04:00
Marc-André Moreau 5b92413843 freerdp: purge deprecated stream utils 2013-05-08 16:09:16 -04:00
Marc-André Moreau b4cac74136 xfreerdp-server: fix RemoteFX encoding 2013-05-01 18:15:55 -04:00
Marc-André Moreau 51715636a5 freerdp: remove some deprecated stream utils 2013-04-29 22:35:15 -04:00
Marc-André Moreau 8c8a82c31f libfreerdp-utils: purge old STREAM utils 2013-03-21 16:45:25 -04:00
Marc-André Moreau 62eec0c2b5 libfreerdp-utils: rename internal members of STREAM to match new wStream 2013-03-21 15:01:46 -04:00