summaryrefslogtreecommitdiffstats
path: root/sesman/libscp/libscp_v0.c
diff options
context:
space:
mode:
authorPavel Roskin <plroskin@gmail.com>2016-02-10 01:14:40 -0800
committerPavel Roskin <plroskin@gmail.com>2016-02-10 09:30:23 -0800
commit5d23d007e9ec0dbc5a43d3bc66326574b6df1e0e (patch)
treeaa38753d47e3451cb18c444094a1e8c7f1d41f34 /sesman/libscp/libscp_v0.c
parent7e20d421cc46132d66ea66d5793e4e2af8fba6c0 (diff)
downloadxrdp-proprietary-5d23d007e9ec0dbc5a43d3bc66326574b6df1e0e.tar.gz
xrdp-proprietary-5d23d007e9ec0dbc5a43d3bc66326574b6df1e0e.zip
Check return value of scp_session_set_bpp()
Diffstat (limited to 'sesman/libscp/libscp_v0.c')
-rw-r--r--sesman/libscp/libscp_v0.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sesman/libscp/libscp_v0.c b/sesman/libscp/libscp_v0.c
index 8cf1340b..7fbdd2e8 100644
--- a/sesman/libscp/libscp_v0.c
+++ b/sesman/libscp/libscp_v0.c
@@ -252,7 +252,14 @@ scp_v0s_accept(struct SCP_CONNECTION *c, struct SCP_SESSION **s, int skipVchk)
scp_session_set_height(session, sz);
/* bpp */
in_uint16_be(c->in_s, sz);
- scp_session_set_bpp(session, (tui8)sz);
+ if (0 != scp_session_set_bpp(session, (tui8)sz))
+ {
+ scp_session_destroy(session);
+ log_message(LOG_LEVEL_WARNING,
+ "[v0:%d] connection aborted: unsupported bpp: %d",
+ __LINE__, (tui8)sz);
+ return SCP_SERVER_STATE_INTERNAL_ERR;
+ }
if (s_check_rem(c->in_s, 2))
{