diff options
| author | Koichiro IWAO <meta@vmeta.jp> | 2018-01-13 22:10:48 +0900 |
|---|---|---|
| committer | Koichiro IWAO <meta@vmeta.jp> | 2018-01-17 09:38:28 +0900 |
| commit | b17c45d86fc2f22fcff8cb9adf31080738edd37a (patch) | |
| tree | c7f93f89855a67a7d45706c9655626bcef5efe7a /xrdp/xrdp_wm.c | |
| parent | 5daa09171e1e6e65a1a3ab969775fdf8affffc37 (diff) | |
| download | xrdp-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 'xrdp/xrdp_wm.c')
| -rw-r--r-- | xrdp/xrdp_wm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/xrdp/xrdp_wm.c b/xrdp/xrdp_wm.c index 3d16fe63..8b26718d 100644 --- a/xrdp/xrdp_wm.c +++ b/xrdp/xrdp_wm.c @@ -405,7 +405,7 @@ xrdp_wm_load_static_colors_plus(struct xrdp_wm *self, char *autorun_name) g_snprintf(cfg_file, 255, "%s/xrdp.ini", XRDP_CFG_PATH); fd = g_file_open(cfg_file); - if (fd > 0) + if (fd >= 0) { names = list_create(); names->auto_free = 1; |
