diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2020-01-14 13:57:27 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2020-01-14 13:57:27 -0500 |
commit | 81b0b397f59e5f06067add712ba9905db6209b8f (patch) | |
tree | d3902fa6698fc92e01410630a1c8f71ad34f735f /src | |
parent | 03e7773319ae3d789f149ace7bc922b4ada43030 (diff) | |
download | spmc-81b0b397f59e5f06067add712ba9905db6209b8f.tar.gz |
Handle realpath() error when string is NULL
Diffstat (limited to 'src')
-rw-r--r-- | src/fs.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -13,6 +13,11 @@ FSTree *fstree(const char *_path) { FTSENT *node = NULL; FSTree *fsdata = NULL; char *path = realpath(_path, NULL); + if (path == NULL) { + perror(_path); + fprintf(SYSERROR); + return NULL; + } char *root[2] = { path, NULL }; size_t dirs_size = 2; |