projects
/
platform
/
upstream
/
freerdp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4239660
)
cache: Check return value from offscreen_cache_get
author
Ondrej Holy
<oholy@redhat.com>
Mon, 4 Sep 2017 16:48:25 +0000
(18:48 +0200)
committer
Ondrej Holy
<oholy@redhat.com>
Thu, 7 Sep 2017 07:38:44 +0000
(09:38 +0200)
Currently, SetSurface is called regardless of return value from
offscreen_cache_get. It may happen that bitmap is not found in a
cache from some reason, which may lead to segfaults. Let's check
the returned value before use.
https://github.com/FreeRDP/FreeRDP/issues/4117
libfreerdp/cache/offscreen.c
patch
|
blob
|
history
diff --git
a/libfreerdp/cache/offscreen.c
b/libfreerdp/cache/offscreen.c
index
df79fc8
..
93fb08e
100644
(file)
--- a/
libfreerdp/cache/offscreen.c
+++ b/
libfreerdp/cache/offscreen.c
@@
-101,6
+101,9
@@
static BOOL update_gdi_switch_surface(rdpContext* context,
{
rdpBitmap* bmp;
bmp = offscreen_cache_get(cache->offscreen, switchSurface->bitmapId);
+ if (bmp == NULL)
+ return FALSE;
+
bitmap->SetSurface(context, bmp, FALSE);
}