Skip to content

Commit

Permalink
Fix director crash on dir command with long filenames
Browse files Browse the repository at this point in the history
Fixes #383: dir command in bconsole crash bareos-dir
  • Loading branch information
Marco van Wieringen committed Feb 17, 2015
1 parent ac7bd72 commit c12d25f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/dird/ua_tree.c
Expand Up @@ -775,8 +775,9 @@ static int lsmarkcmd(UAContext *ua, TREE_CTX *tree)
/*
* This is actually the long form used for "dir"
*/
static void ls_output(guid_list *guid, POOLMEM *buf, const char *fname,
const char *tag, struct stat *statp, bool dot_cmd)
static inline void ls_output(guid_list *guid, POOLMEM **buf,
const char *fname, const char *tag,
struct stat *statp, bool dot_cmd)
{
char mode_str[11];
char time_str[22];
Expand Down Expand Up @@ -888,7 +889,7 @@ static int do_dircmd(UAContext *ua, TREE_CTX *tree, bool dot_cmd)
memset(&statp, 0, sizeof(statp));
}

ls_output(guid, buf, cwd, tag, &statp, dot_cmd);
ls_output(guid, &buf, cwd, tag, &statp, dot_cmd);
ua->send_msg("%s\n", buf);

free_pool_memory(cwd);
Expand Down

0 comments on commit c12d25f

Please sign in to comment.