Commit Graph

90 Commits

Author SHA1 Message Date
Armin Novak
28ac0ee146 Fixed NULL dereferences. 2018-05-04 12:42:44 +02:00
Armin Novak
e5767f07ac Refactored order updates
Unified order creation/copy/delete to avoid memory leaks.
2018-05-02 08:54:21 +02:00
Martin Fleisz
811406382d core: Fix possible out-of-bounds read 2018-03-06 15:52:34 +01:00
Armin Novak
c60c355a9d Added ROP to primary order debug message. 2017-12-22 10:37:04 +01:00
Ondrej Holy
9cccd4888d orders: Fix OFFSCREEN_DELETE_LIST allocation size
The size of OFFSCREEN_DELETE_LIST list allocation was incorrectly changed
by commit 99b1481 and consequently fixed incorrectly by commit 8a0fe086.
Let's count the allocation size based on new size and not based on current
size in order to prevent some memory issues.

https://github.com/FreeRDP/FreeRDP/issues/4117
2017-09-07 09:38:44 +02:00
Ondrej Holy
048e7f264b orders: Fix ORDER_TYPE_GDIPLUS_END check
Commit 6fd03ab introduced security checks for orders, but
ORDER_TYPE_GDIPLUS_END check fails in case of success and vice versa.
Let's add the missing question mark.

https://github.com/FreeRDP/FreeRDP/issues/4117
2017-09-07 09:38:44 +02:00
Armin Novak
d46d0c3d4a Fixed invalid return from xf_rail_window_icon 2017-03-28 11:47:46 +02:00
Armin Novak
b2c29158be Scanbuild warning, argument checks and leak fixes.
* Added Stream_GetRemainingCapacity to check remaining stream size
  before writes.
* Fixed shadow server memory leak.
* Fixed lots of scanbuild warnings
* Added missing argument checks in many functions
* Added missing static function declarations
2017-03-02 18:13:43 +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
Armin Novak
a76b0df598 Fixed reading of colors from order. 2016-10-06 13:43:06 +02:00
Armin Novak
a372009fc4 Internal functions static. 2016-10-06 13:43:04 +02:00
Armin Novak
bb82d48506 Fixed part of font cache issue. 2016-10-06 13:43:03 +02:00
Armin Novak
e650fdb2b6 Bugfixes. 2016-10-06 13:43:02 +02:00
Armin Novak
17fd5526ac Cleanups. 2016-10-06 13:43:02 +02:00
Armin Novak
c229a1939d Updated codec API, unified drawing order color decoding. 2016-10-06 13:43:02 +02:00
Armin Novak
f9a89ae6b4 Bug fixes, refactoring. 2016-10-06 13:43:01 +02:00
Armin Novak
df35c135d1 Fixed color conversion, unified GFX and updated API. 2016-10-06 13:42:58 +02:00
Armin Novak
e79eee2bb1 Fixed Stream API misuse. 2016-02-25 20:01:12 +01:00
Marc-André Moreau
ddf2519f1e Merge pull request #2719 from bmiklautz/pull/2481
OSS, tsmf, usb and BSD fixes and improvements
2015-06-26 08:27:22 -04:00
Bernhard Miklautz
ff8d172a12 core: use error instead of debug
When the function would return with an error print an error message
instead of a debug message
2015-06-23 11:15:13 +02: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
ivan-83
0fda0eb0de Code style changed. 2015-05-27 22:59:57 +03:00
ivan-83
1009268158 * debug and error messages now print function name and line number
* add debug messages to trace fake network dissconects
2015-05-27 22:57:10 +03:00
Bernhard Miklautz
79de8168f9 Integrate feedback from pull request
* orders.c: remove ; at eol
* rdpdr_main.c: simplify error case
* rdpsnd_pulse.c: fix incorrect check
* rdpsnd_main.c: adapt return value according to documentation
* update.c: fix incorrect return values
2015-03-30 18:29:32 +02:00
Bernhard Miklautz
74c8400789 coding style fixes
Add missing space after if
2015-03-30 17:15:45 +02:00
Bernhard Miklautz
f469e069dc stream: Stream_Ensure*Capacity: change return type
Change the return type of Stream_Ensure*Capacity from void to BOOL to be
able to detect realloc problems easily. Otherwise the only way to detect
this was to check if the capacity after the call was >= the required
size.
In case Stream_Ensure*Capacity fails the old memory is still available
and need to freed outside.

This commit also adds checks to most calls of Stream_Ensure*Capacity to
check if the call was successful.
2015-03-30 16:33:48 +02:00
Jean-Louis Dupond
ede7993fe8 libfreerdp-core: Initialize values correctly 2015-03-15 14:09:16 +01:00
Jean-Louis Dupond
8a0fe0861d fix size error introduced in commit 99b14815a5 2015-03-15 11:50:10 +01: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
fdd2dc7601 freerdp: patch valgrind leaks, cleanup 2014-12-03 14:17:27 -05:00
Zhang Zhaolong
3de5c62bf3 fix polyline. 2014-10-09 18:11:38 +08:00
Armin Novak
2f519d7f16 Replaced logging in libfreerdp with wlog defines. 2014-09-15 08:48:46 +02:00
Marc-André Moreau
82a53057a1 Merge pull request #2023 from ptsekov/software-gdi-improvements
Software GDI improvements
2014-08-18 16:22:23 -04:00
Armin Novak
f4c133eaf8 Replaced custom logging mechanism with WLog wrapper. 2014-08-07 16:51:24 +02:00
Pavel Tsekov
c51c5df2ff * include/freerdp/codec/color.h:
(freerdp_color_convert_drawing_order_color_to_gdi_color): Declare new
function.
* libfreerdp/codec/color.c:
(freerdp_color_convert_drawing_order_color_to_gdi_color): Implement.
(freerdp_image_convert_8bpp): Properly use the ARGB32/ABGR32/RGB32/BGR32
macros when converting 8bpp data to 32bpp.
(freerdp_image_convert_32bpp): Fix CLRCONV_ALPHA and CLRCONV_INVERT
processing for 32bpp destination.
(freerdp_mono_image_convert): Use ARGB32/ABGR32 when converting to 32bpp
and CLRCONV_ALPHA is set.
* libfreerdp/core/orders.c: Color data from drawing orders is
interpreted in big endian mode.
* libfreerdp/core/update.c (update_read_palette): Likewise.
* libfreerdp/gdi/16bpp.c (gdi_get_color_16bpp): GDI colors are stored as
RGB now.
* libfreerdp/gdi/32bpp.c (gdi_get_color_32bpp): Likewise.
* libfreerdp/gdi/gdi.c:
Use freerdp_color_convert_drawing_order_color_to_gdi_color() to convert
from drawing order color representation to GDI color representation
troughout.
* libfreerdp/gdi/graphics.c (gdi_Glyph_BeginDraw): Likewise.
(gdi_Glyph_EndDraw): Likewise.
2014-08-07 00:58:58 +03:00
Hardening
07e0eba7db Check that bpp has reasonable value
As bpp is often used for malloc computations, let's check that it has
a reasonable value.
2014-05-29 10:12:02 +02:00
Hardening
597cba042a Fix some compilation warnings 2014-04-29 16:02:31 +02:00
Hardening
c03c1c75f3 Fix typo in update_write_4byte_unsigned() 2014-04-27 23:21:30 +02:00
Marc-André Moreau
cdcd290c44 wfreerdp: fix most build warnings 2014-02-10 22:12:13 -05:00
Marc-André Moreau
3e3c0f1942 libfreerdp-core: fix potential asynchronous queuing memory problems for primary drawing orders 2013-11-03 13:29:48 -05:00
Marc-André Moreau
1fc2d780f7 libfreerdp-core: fix memory leaks reported by valgrind 2013-10-31 23:35:24 -04:00
Marc-André Moreau
a24d31be31 libfreerdp-core: refactor and add new WLog debug output for graphical orders 2013-10-10 13:00:04 -04:00
Bernhard Miklautz
c99d9ee72b core/glyph: copy data when adding glyph to cache
fixes #1500
2013-09-24 23:25:18 +02:00
Marc-André Moreau
7246cf1f8f libfreerdp-core: reduce usage of update_force_flush in server-side update code 2013-07-29 10:21:32 -04:00
Marc-André Moreau
404f66820b libfreerdp-core: force flushing of updates 2013-06-09 20:37:58 -04:00
Marc-André Moreau
49b056bec0 libfreerdp-core: added orders buffer size approximation functions 2013-06-09 17:56:57 -04:00
Marc-André Moreau
fc592a1750 libfreerdp-core: replace usage of Stream_GetPointer() by Stream_GetPosition() in potentially unsafe places 2013-05-15 14:42:37 -04:00
Marc-André Moreau
367ebf32a3 freerdp: make use of stream macros to access members 2013-05-15 12:14:26 -04:00
Marc-André Moreau
c9ebd98e00 libfreerdp-core: stub and implement many new server-side graphical orders 2013-05-12 17:46:13 -04:00
Marc-André Moreau
268004d0c9 libfreerdp-core: start implementing server-side alternate secondary drawing orders 2013-05-12 13:42:53 -04:00