Commit Graph

69 Commits

Author SHA1 Message Date
akallabeth
cd4d77af86 [settings] add deprecation warnings
direct struct access to rdpSettings now produces warnings if not
explicitly deactiaved by defining FREERDP_SETTINGS_INTERNAL_USE
2023-11-24 14:54:56 +01:00
akallabeth
1163cc4d5c [core] add internal settings.h include 2023-11-24 14:54:56 +01:00
akallabeth
075506f6c8 [winpr,stream] use new Stream_CheckAndLogRequiredLength* 2023-01-25 14:27:32 +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
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
d210ac5e33 Removed internal members of rdpUpdate from API header 2022-01-18 11:24:23 +01:00
akallabeth
7b7e2d6f32 Prefer constant division over multiplication for length checks 2021-09-21 08:55:22 +02:00
Jeremy Cross
6547db2f17 early bail from update_read_window_state_order when handling WINDOW_ORDER_FIELD_WND_RECTS breaks subsequent protocol parsing 2021-09-21 07:43:03 +02:00
akallabeth
6c0aeb10d2 Allow icon info with empty bitmap data. 2020-04-09 18:00:51 +02:00
akallabeth
6b2bc41935 Fix #6010: Check length in read_icon_info 2020-04-02 17:34:02 +02:00
Mati Shabtay
4dacb57f6f rail server: implement channel code for rail server
* Split common functionality from client code
* Clean up client code and use proper defines for constants
* Implements the channel code to read/write server side
  messages.
2019-12-12 11:10:44 +01:00
David Fort
6123920a2e opencl: inline the openCL program in the source code 2019-11-22 13:21:39 +01:00
David Fort
7b743b3199 rails: shorten logs 2019-11-22 13:21:39 +01:00
Armin Novak
72ca88f49c Reformatted to new style 2019-11-07 10:53:54 +01:00
Armin Novak
58c4e639f1 Fixed type mismatch. 2019-06-25 10:49:53 +02:00
Martin Fleisz
20c4e3bab0
Merge pull request #5415 from akallabeth/dump_append_fix
Fixed format security issues.
2019-06-04 09:14:59 +02:00
Martin Fleisz
1f5ded4611 RAIL: Fix parsing of WINDOW_ORDER_FIELD_ICON_OVERLAY_NULL (#5421) 2019-06-03 09:05:43 +02:00
Armin Novak
c6e1208457 Fixed format security issues. 2019-05-24 09:28:08 +02:00
David Fort
6563bc28c4 rail: added verbose logs (#5402)
* rail: added verbose logs

* rail: fix buffer initialisation in debug message
2019-05-23 12:15:26 +02:00
Armin Novak
95a7447366 Fixed window order cleanup for NOTIFY_ICON_STATE_ORDER 2019-05-09 13:24:22 +02:00
Armin Novak
2cc714a57d Updated RAILS implementation
* Implement new messages and callbacks
* Announce most recent channel features
* Added settings to configure flags to announce
2019-05-08 17:25:15 +02:00
Armin Novak
4d7bece6ea Fixed order mask 2018-11-15 09:52:54 +01:00
Armin Novak
dd80a09781 Allow window orders with AllowUnanouncedOrdersFromServer 2018-11-15 09:52:54 +01:00
Armin Novak
c0b13cf43f Added checks for order type window support. 2018-11-15 09:52:50 +01:00
Armin Novak
98a537d05d Better description and formatting for update_read_icon_info 2018-11-14 11:57:57 +01:00
Armin Novak
7e12955c55 Made all internal functions static. 2018-11-14 11:57:57 +01:00
ilammy
7a2b6e1301 libfreerdp-core: fix reading TS_ICON_INFO
The spec says that CbColorTable field is present when Bpp is 1, 4, 8.
Actually, bpp == 2 is not supported by TS_ICON_INFO according to the
spec (though, DIB definitely supports 16-color images).

    MS-RDPERP 2.2.1.2.3 Icon Info (TS_ICON_INFO)

    CbColorTable (2 bytes):
        This field is ONLY present if the bits per pixel (Bpp)
        value is 1, 4, or 8.

Omitting 8-bit value breaks 256-color icons which are incorrectly
read with color and alpha data mixed up.
2018-11-14 10:53:45 +01:00
Armin Novak
83fba667c1 Fixed logging. 2018-10-15 13:56:19 +02:00
Bernhard Miklautz
e7cd3250c3 Fix a regression introduced with PR #4013
If numWindowRects/numVisibilityRects is zero a realloc might either
return NULL or a free able memory. In the first case the introduced
regression caused a double free.
As 0 is a possible value that can be received in both cases rail was
broken.

Fixes #4022
2017-06-29 11:28:03 +02:00
weizhenwei
ef540ee2df code format adjustment 2017-06-23 09:50:56 +08:00
weizhenwei
5d8d3b53c5 remove redundant NULL pointer check 2017-06-23 09:44:40 +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
fa1c65b656 refactor to remove duplicate code and replace free+malloc with realloc 2017-06-22 10:21:20 +08:00
weizhenwei
2d56e22e9e refactor on redundant code copy 2017-06-21 22:07:07 +08:00
weizhenwei
d77802d5e9 fix memroy leak of window_icon->iconInfo at update_read_window_icon_order() 2017-06-21 15:26:28 +08:00
weizhenwei
2f96df25fa fix memory leak at update->window->window_state.windowRects/visibilityRects at update_read_window_state_order() 2017-06-21 15:26:28 +08: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
ef4b29e5b3 ConvertFromUnicode fixes and misc hardening
- Added missing ConvertFromUnicode checks
- If ConvertToUnicode allocates memory, guarantee the null termination
  similar to ConvertFromUnicode's implementation
- Fixed some TestUnicodeConversion.c CTest return values
- Added some CTests for ConvertFromUnicode and ConvertToUnicode
- Misc code and protocol hardening fixes in the surrounding code regions
  that have been touched
2016-03-03 16:56:19 +01:00
David FORT
7c3f8f33ab Fixes for malloc / calloc + other fixes
This patch contains:

* checks for malloc return value + treat callers;
* modified malloc() + ZeroMemory() to calloc();
* misc fixes of micro errors seen during the code audit:
** some invalid checks in gcc.c, also there were some possible
integer overflow. This is interesting because at the end the data are parsed
and freed directly, so it's a vulnerability in some kind of dead code (at least
useless);
** fixed usage of GetComputerNameExA with just one call, when 2 were used
in misc places. According to MSDN GetComputerNameA() is supposed to return
an error when called with NULL;
** there were a bug in the command line parsing of shadow;
** in freerdp_dynamic_channel_collection_add() the size of array was multiplied
by 4 instead of 2 on resize
2015-06-22 19:21:47 +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
David FORT
c330a3715e Fix empty window title
When the size of a RAIL string was 0, we were reporting an OOM error.
2015-05-07 15:08:00 +02:00
Jonathan Kaplan
8dee5dab27 Fix issue when numWindowIds is 0 2015-04-28 00:21:38 -07:00
Armin Novak
6b0667c959 Fixed use after free and realloc checks. 2015-03-31 15:18:45 +02:00
Zhang Zhaolong
99b14815a5 core: fix incorrect usage of realloc.
realloc can handle the case that its first parameter is NULL.

Signed-off-by: Zhang Zhaolong <zhangzl2013@126.com>
2015-03-11 13:40:20 +08:00
Marc-André Moreau
589c21d819 libfreerdp-utils: remove rail utils 2014-11-12 10:18:53 -05:00
Armin Novak
2f519d7f16 Replaced logging in libfreerdp with wlog defines. 2014-09-15 08:48:46 +02:00
Armin Novak
f4c133eaf8 Replaced custom logging mechanism with WLog wrapper. 2014-08-07 16:51:24 +02:00