diff options
author | taesub kim <taesub.kim@samsung.com> | 2017-10-10 08:35:22 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@review.ap-northeast-2.compute.internal> | 2017-10-10 08:35:23 +0000 |
commit | d705f608d26e9a1c3a2cb7b078c154451181f867 (patch) | |
tree | f2fbf21e724f14aa7f76146eed71be837fcfe648 | |
parent | ccac24c41631a6edf79233362a7e60970b3a90cd (diff) | |
parent | 88e1178c2cbc87a27ada13569f80cd46f9d44aa5 (diff) | |
download | connman-d705f608d26e9a1c3a2cb7b078c154451181f867.tar.gz connman-d705f608d26e9a1c3a2cb7b078c154451181f867.tar.bz2 connman-d705f608d26e9a1c3a2cb7b078c154451181f867.zip |
Merge "[CID-32919, 33501] Fix bug" into tizen
-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); |