diff options
Diffstat (limited to 'lib/fstree/fstree_from_dir.c')
-rw-r--r-- | lib/fstree/fstree_from_dir.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/fstree/fstree_from_dir.c b/lib/fstree/fstree_from_dir.c index d6fac86..9aab5df 100644 --- a/lib/fstree/fstree_from_dir.c +++ b/lib/fstree/fstree_from_dir.c @@ -25,7 +25,6 @@ static char *get_file_path(tree_node_t *n, const char *name) { char *ptr, *new; - size_t len; int ret; if (n->parent == NULL) { @@ -42,13 +41,7 @@ static char *get_file_path(tree_node_t *n, const char *name) ret = canonicalize_name(ptr); assert(ret == 0); - if (SZ_ADD_OV(strlen(ptr), strlen(name), &len) || - SZ_ADD_OV(len, 2, &len)) { - errno = EOVERFLOW; - goto fail; - } - - new = realloc(ptr, len); + new = realloc(ptr, strlen(ptr) + strlen(name) + 2); if (new == NULL) goto fail; |