diff options
author | chleun.moon <chleun.moon@samsung.com> | 2017-10-10 16:31:22 +0900 |
---|---|---|
committer | chleun.moon <chleun.moon@samsung.com> | 2017-10-10 16:32:11 +0900 |
commit | 88e1178c2cbc87a27ada13569f80cd46f9d44aa5 (patch) | |
tree | bf66cfdf4ffe95b9f10b2c237248e221f56a9dbb /vpn | |
parent | 796441c4296905691f55c893e73e7b8704b49f73 (diff) | |
download | connman-88e1178c2cbc87a27ada13569f80cd46f9d44aa5.tar.gz connman-88e1178c2cbc87a27ada13569f80cd46f9d44aa5.tar.bz2 connman-88e1178c2cbc87a27ada13569f80cd46f9d44aa5.zip |
[CID-32919, 33501] Fix bug
Change-Id: I8fc3c40c8a2cf3d9e5fb840796d0f0bf0b66a072
Signed-off-by: Cheoleun Moon <chleun.moon@samsung.com>
Diffstat (limited to 'vpn')
-rw-r--r-- | vpn/plugins/ipsec.c | 6 | ||||
-rw-r--r-- | vpn/plugins/vici-client.c | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/vpn/plugins/ipsec.c b/vpn/plugins/ipsec.c index fa9dc7af..617830cf 100644 --- a/vpn/plugins/ipsec.c +++ b/vpn/plugins/ipsec.c @@ -796,6 +796,12 @@ static char *load_file_from_path(const char *path) } fd = fileno(fp); + if (fd == -1) { + connman_error("fp is not a valid stream"); + fclose(fp); + return NULL; + } + fstat(fd, &st); file_size = st.st_size; file_buff = g_try_malloc0(sizeof(char)*st.st_size); diff --git a/vpn/plugins/vici-client.c b/vpn/plugins/vici-client.c index dc651cfd..94228945 100644 --- a/vpn/plugins/vici-client.c +++ b/vpn/plugins/vici-client.c @@ -280,6 +280,12 @@ static char *load_cert_from_path(const char *path) } fd = fileno(fp); + if (fd == -1) { + connman_error("fp is not a valid stream"); + fclose(fp); + return NULL; + } + fstat(fd, &st); file_size = st.st_size; file_buff = g_try_malloc0(sizeof(char)*st.st_size); |