Commit Graph

109 Commits

Author SHA1 Message Date
Martin Fleisz
c88c777482 drive: Fix double free in client drive channel 2023-07-05 14:02:31 +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
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
0f60ac5988 Fixed path validation in drive channel
Check that canonical path is a subpath of the shared directory
2022-11-14 09:28:22 +01:00
akallabeth
96aef5f1af Fixed missing stream length check in drive_file_query_directory 2022-11-14 09:28:22 +01: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
6b485b146a Fixed oob read in irp_write and similar 2020-05-06 13:31:57 +02:00
David Fort
d7e510016a
Merge pull request #5736 from akallabeth/makecert_cleanups
Cleaned up code for makecert.
2019-11-20 23:26:31 +01:00
Armin Novak
a5bebd3c65 Fixed scanbuild warnings. 2019-11-20 09:17:08 +01:00
Armin Novak
f9b3f270fe Fixed path NULL checks. 2019-11-19 10:48:25 +01:00
Armin Novak
4c5bfcc235 Fixed #5727: drive_process_irp_create set path to NULL if not provided. 2019-11-18 15:25:18 +01:00
Armin Novak
57a57a917a Fixed #5727: Remove forbidden symbols from drive name 2019-11-18 14:31:46 +01:00
Armin Novak
72ca88f49c Reformatted to new style 2019-11-07 10:53:54 +01:00
Armin Novak
64f64cd035 devman_load_device_service device argument can be const. 2019-10-24 15:04:48 +02:00
Armin Novak
fdf1715213 Unified DriveStoreRedirect parsing. 2019-08-23 12:06:21 +02:00
Norbert Federa
0572572eb9 fix issue with fnObjectFree and related casts
- remove unnecessary/dangerous OBJECT_xxx function-style casts
- fix -Wstrict-prototypes issue with OBJECT_NEW_FN definition
2018-10-19 11:30:01 +02:00
Ondrej Holy
4b8f2d5137 channels/drive: Fix leak found by covscan
leaked_storage: Variable "outStr" going out of scope leaks the storage it points to.
2018-08-22 13:35:43 +02:00
Armin Novak
adc0882f8d Removed obsolete winodws path hack. 2018-07-30 13:16:45 +02:00
Armin Novak
93fa8eb0d2 Fixed windows automount drive arguments. 2018-07-30 12:58:15 +02:00
Armin Novak
e8393a22e2 Remember if drive was added by automout. 2018-07-30 12:31:11 +02:00
Ilya Shipitsin
14c15c680d resolve several possible null pointer dereference
issue detected by cppcheck

[channels/drive/client/drive_main.c:454] -> [channels/drive/client/drive_main.c:443]: (warning) Either the condition '!irp' is redundant or there is possible null pointer dereference: irp.
[client/X11/xf_window.c:582] -> [client/X11/xf_window.c:580]: (warning) Either the condition '!xfc' is redundant or there is possible null pointer dereference: xfc.
[winpr/libwinpr/path/test/TestPathShell.c:40] -> [winpr/libwinpr/path/test/TestPathShell.c:43]: (warning) Either the condition '!path' is redundant or there is possible null pointer dereference: path.
[winpr/libwinpr/path/test/TestPathShell.c:49] -> [winpr/libwinpr/path/test/TestPathShell.c:52]: (warning) Either the condition '!path' is redundant or there is possible null pointer dereference: path.
2018-03-24 17:46:39 +05:00
Armin Novak
2517755d25 Fixed thread function return and parameters. 2018-03-07 14:36:55 +01:00
Martin Fleisz
9b4de7903f drive: Fix possible NULL ptr access 2018-03-06 16:34:36 +01:00
David Fort
a132922376 Add checks for DR channel 2017-10-04 10:30:47 +02:00
David Fort
b624ecbfce Fix for #4161
The checks were wrong, fix them.
2017-10-02 20:57:27 +02:00
Armin Novak
d1ebc39b07 Fixed file errno mapping. 2017-07-24 15:05:48 +02:00
Armin Novak
9a2c9c47d7 Fixed buffer read. 2017-07-24 11:32:54 +02:00
Armin Novak
6a06c8d991 Additional error checks for drive channel. 2017-07-24 11:31:48 +02:00
Armin Novak
478ca97a16 Fixed resource cleanup. 2017-07-20 09:35:41 +02:00
Norbert Federa
36b8f54c5e Fixed a few compiler warnings 2017-07-10 17:52:05 +02:00
weizhenwei
bd94dcc6d5 remove duplicate code when freeing drive 2017-06-23 09:28:42 +08:00
weizhenwei
3b52a60d31 remove useless NULL pointer check before free 2017-06-23 09:21:16 +08:00
weizhenwei
61b24bf0b3 add NULL pointer check and set freed pointers to NULL afterward 2017-06-22 17:53:51 +08:00
weizhenwei
a2ecf403b2 fix memory leak at drive_register_drive_path() and drive_free() 2017-06-21 15:26:28 +08:00
joy.you
921f0b7480 fixed issue:#3974
ConvertToUnicode failed
2017-05-27 16:10:41 +08:00
Armin Novak
ed2c675a83 Fixed path length check. 2017-05-18 09:43:02 +02:00
Armin Novak
6b960a4319 Fix #3962: Remove trailing slashes from path. 2017-05-17 16:43:16 +02:00
Armin Novak
73e89bffcc Cleaned up includes. 2017-04-19 08:27:22 +02:00
David PHAM-VAN
5a66fe841a Misc Fixes 2017-03-17 14:07:33 -07:00
David PHAM-VAN
d6f78df195 Verify ConvertFromUnicode return values 2017-03-16 16:27:01 -07:00
David PHAM-VAN
c7924b554d Rewrite drive channel using WinPR functions 2017-03-13 14:18:46 -07: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