Commit Graph

177 Commits

Author SHA1 Message Date
Martin Fleisz
45ee30da5e rdpdr: Fix potential null pointer access 2023-08-02 19:09:26 +02:00
Armin Novak
99bf501f0f [channels,drive] remove unused member filename 2023-07-26 10:57:42 +02:00
Armin Novak
4154779672 [channel,drive] path must not end with separator
the fullpath string must not end with a path separator as FindFirstFile
returns an error in such cases.
2023-07-26 10:57:42 +02:00
Armin Novak
c4f93891fd [channels,drive] use winpr recursive directory remove 2023-07-26 10:57:42 +02:00
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
akallabeth
c3a82daad6 [channels] simplified client linking 2023-03-01 08:18:34 +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
Martin Fleisz
b5e8b419b8 drive: Fix an issue when redirecting drives on Windows
CreateFile/GetFileInformationByHandle will fail if used with just a
drive letter i.e. C:/.

This PR fixes that case by using GetFileAttributesExW as a fallback in
case CreateFileW fails.
2022-11-03 15:02:27 +01:00
akallabeth
1849632c43
Fixed format strings to match arguments (#8254)
* Fixed format strings to match arguments

Reviewed and replaced all %d specifiers to match proper type

* Added proxy dynamic channel command type to log messages.
2022-09-29 14:55:27 +02:00
akallabeth
bc8b4ade1c reformatted 2022-06-23 08:48:39 +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
Zhengyi Fu
75a6e17752 drive: fix number of links 2022-03-24 13:40:31 +01: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
Armin Novak
8ef57bf296 Replaced CMAKE_[SOURCE|BINARY]_DIR with PROJECT_[SOURCE|BINARY]_DIR
Thanks @Pollux42 for the hint in #7096
2021-06-22 08:54:18 +02:00
Biswapriyo Nath
173ab04b59 Use same data types as calling function prototypes. 2021-05-31 13:38:19 +02:00
akallabeth
6b485b146a Fixed oob read in irp_write and similar 2020-05-06 13:31:57 +02:00
David Fort
5e6775ce95 winpr: fix anonymous enum members and menbers without a size 2019-11-25 13:39:31 +01: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
Martin Fleisz
20c585bd18 rdpdr: Fix error code reporting for create PDUs 2019-10-01 14:34:36 +02:00
Armin Novak
fdf1715213 Unified DriveStoreRedirect parsing. 2019-08-23 12:06:21 +02:00
Armin Novak
485061e4d0 Fix #5317: Change file attributes before modifying file time. 2019-03-29 15:45:52 +01:00
Armin Novak
4ba73e0c73 Fixed warnings found by compiler and static analysis. 2019-01-24 11:53:52 +01:00
Armin Novak
805741bdf6 Fixed #5185 broken file size initialization. 2019-01-14 14:54:33 +01:00
Armin Novak
fdf9ca3273 Fixed #5113: The timestamps for FileFullDirectoryInformation were inverted. 2018-12-07 10:59:52 +01: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
David Fort
ba69925b8d
Merge pull request #4501 from akallabeth/drive_file_size_fix
Removed xrdp workarounds.
2018-09-24 16:00:27 +02:00
Martin Fleisz
8248dcb3bb
Merge pull request #4816 from akallabeth/drive_cmd_fix
Fix #4680: Return proper directory name.
2018-08-24 09:45:26 +02:00
Armin Novak
ab18f8f222 Fix #4680: Return proper directory name. 2018-08-23 10:04:26 +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
dbd630a38c drive_file_query_information: Use GetFileAttributesExW 2018-08-13 13:40:59 +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