projects
/
platform
/
upstream
/
connman.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
[CID-32919, 33501] Fix bug
[platform/upstream/connman.git]
/
vpn
/
plugins
/
ipsec.c
diff --git
a/vpn/plugins/ipsec.c
b/vpn/plugins/ipsec.c
index
fa9dc7a
..
617830c
100644
(file)
--- 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);