Commit Graph

189 Commits

Author SHA1 Message Date
akallabeth
586f40631f
[warnings] fix shorten-64-to-32 2024-09-17 16:13:48 +02:00
akallabeth
965d231e49
[return checks] fix use of CloseHandle 2024-09-16 08:22:31 +02:00
akallabeth
cd18dea174
[return checks] fix use of unicode functions 2024-09-16 06:48:26 +02:00
akallabeth
fe6d861a5c
[channels] fix VCAPITYPE for all channel entry points 2024-09-03 17:26:58 +02:00
Armin Novak
fe76bafd57 [channels,drive] fix out of bound access 2024-08-21 09:20:25 +02:00
akallabeth
9a2a1c3717
[channel,drive] fix directory traversal detection
filter out .. part of the file or directory name.
2024-07-01 17:10:23 +02:00
akallabeth
b9a1f791f7 [channels,drive] fix wrong function usage
_wcslen is for WCHAR, wcslen for wchar_t
2024-03-18 13:27:32 +01: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
207def5c56 [clang-tidy] readability-isolate-declaration 2024-02-15 11:49:16 +01:00
Armin Novak
9575f386cd fixed WCHAR constants, use endian safe definitions 2023-12-20 09:03:58 +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
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