summaryrefslogtreecommitdiff
path: root/coreutils/diff.c
diff options
context:
space:
mode:
authorDenis Vlasenko2007-04-05 21:29:42 +0000
committerDenis Vlasenko2007-04-05 21:29:42 +0000
commitdf5bbb938ae73cf668778d1d54718fddb0f76130 (patch)
tree5052edb7b289a828ce9bfef5e85d568503a5cee7 /coreutils/diff.c
parent1bb552b1d9da749050274e0a9cb10b672db22d77 (diff)
downloadbusybox-df5bbb938ae73cf668778d1d54718fddb0f76130.zip
busybox-df5bbb938ae73cf668778d1d54718fddb0f76130.tar.gz
diff: fix segfault on empty dirs (Peter Korsgaard <peter.korsgaard@barco.com>)
Diffstat (limited to 'coreutils/diff.c')
-rw-r--r--coreutils/diff.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/coreutils/diff.c b/coreutils/diff.c
index 1903bb1..7555718 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