From df5bbb938ae73cf668778d1d54718fddb0f76130 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Thu, 5 Apr 2007 21:29:42 +0000 Subject: diff: fix segfault on empty dirs (Peter Korsgaard ) --- coreutils/diff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreutils/diff.c b/coreutils/diff.c index 1903bb151..75557187c 100644 --- a/coreutils/diff.c +++ b/coreutils/diff.c @@ -1070,7 +1070,7 @@ static int add_to_dirlist(const char *filename, static char **get_dir(char *path) { dl_count = 0; - dl = NULL; + dl = xzalloc(sizeof(dl[0])); /* If -r has been set, then the recursive_action function will be * used. Unfortunately, this outputs the root directory along with -- cgit v1.2.3