summaryrefslogtreecommitdiff
path: root/vpn
diff options
context:
space:
mode:
authorchleun.moon <chleun.moon@samsung.com>2017-06-01 02:10:40 (GMT)
committerchleun.moon <chleun.moon@samsung.com>2017-06-01 02:14:59 (GMT)
commit6d0c59f3bfb3b4ef7881f925097dae1f75ea9990 (patch)
treeaf2cfdd0eacf97d2f26b784d9b2911f7baaca8db /vpn
parent6eab13e3a722e2e155401018e3740d3f96235a24 (diff)
downloadconnman-6d0c59f3bfb3b4ef7881f925097dae1f75ea9990.zip
connman-6d0c59f3bfb3b4ef7881f925097dae1f75ea9990.tar.gz
connman-6d0c59f3bfb3b4ef7881f925097dae1f75ea9990.tar.bz2
Add NULL check before referencerefs/changes/54/132054/3
Change-Id: I0485f5c69a2a1699f922b4c2c130f6865f8b31d9 Signed-off-by: cheoleun <chleun.moon@samsung.com>
Diffstat (limited to 'vpn')
-rw-r--r--vpn/plugins/ipsec.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/vpn/plugins/ipsec.c b/vpn/plugins/ipsec.c
index b1a7ecd..b5205f7 100644
--- a/vpn/plugins/ipsec.c
+++ b/vpn/plugins/ipsec.c
@@ -248,6 +248,11 @@ static void read_der_file(const char *path, X509 **cert)
DBG("der path %s\n", path);
fp = fopen(path, "r");
+ if (!fp) {
+ connman_error("fopen %s is failed\n", path);
+ return;
+ }
+
*cert = d2i_X509_fp(fp, NULL);
fclose(fp);
return;
@@ -259,6 +264,11 @@ static void read_pem_file(const char *path, X509 **cert)
DBG("pem path %s\n", path);
fp = fopen(path, "r");
+ if (!fp) {
+ connman_error("fopen %s is failed\n", path);
+ return;
+ }
+
*cert = PEM_read_X509(fp, cert, NULL, NULL);
fclose(fp);
return;