From: Denis Vlasenko Date: Thu, 5 Apr 2007 21:29:42 +0000 (-0000) Subject: diff: fix segfault on empty dirs (Peter Korsgaard ) X-Git-Tag: 1_6_0~232 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=df5bbb938ae73cf668778d1d54718fddb0f76130;p=oweals%2Fbusybox.git diff: fix segfault on empty dirs (Peter Korsgaard ) --- 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