summaryrefslogtreecommitdiffstats
path: root/libxrdp/xrdp_sec.c
diff options
context:
space:
mode:
authorKoichiro IWAO <meta@vmeta.jp>2018-01-13 22:10:48 +0900
committerKoichiro IWAO <meta@vmeta.jp>2018-01-17 09:38:28 +0900
commitb17c45d86fc2f22fcff8cb9adf31080738edd37a (patch)
treec7f93f89855a67a7d45706c9655626bcef5efe7a /libxrdp/xrdp_sec.c
parent5daa09171e1e6e65a1a3ab969775fdf8affffc37 (diff)
downloadxrdp-proprietary-b17c45d86fc2f22fcff8cb9adf31080738edd37a.tar.gz
xrdp-proprietary-b17c45d86fc2f22fcff8cb9adf31080738edd37a.zip
fix potential fd leak
In most cases, checking fd > 0 is not valid. open(2) returns -1 on error, 0 on stdin, 1 on stdout, 2 on stderr, >2 . The border should be between -1 and 0. Additionally, between 2 and 3. Pointed out by: #919
Diffstat (limited to 'libxrdp/xrdp_sec.c')
-rw-r--r--libxrdp/xrdp_sec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libxrdp/xrdp_sec.c b/libxrdp/xrdp_sec.c
index 4de6c9ed..0436edf2 100644
--- a/libxrdp/xrdp_sec.c
+++ b/libxrdp/xrdp_sec.c
@@ -265,7 +265,7 @@ xrdp_load_keyboard_layout(struct xrdp_client_info *client_info)
fd = g_file_open(keyboard_cfg_file);
- if (fd > 0)
+ if (fd >= 0)
{
int section_found = -1;
char section_rdp_layouts[256] = { 0 };