mirror of https://github.com/MidnightCommander/mc
Ticket #4580: mceditor: segfault on new file creation.
(edit_init): fix NULL dereference. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
876555035a
commit
66bfefbf1a
|
@ -2164,7 +2164,10 @@ edit_init (WEdit *edit, const WRect *r, const edit_arg_t *arg)
|
|||
edit->stat1.st_gid = getgid ();
|
||||
edit->stat1.st_mtime = 0;
|
||||
|
||||
edit->attrs_ok = (mc_fgetflags (arg->file_vpath, &edit->attrs) == 0);
|
||||
if (arg != NULL)
|
||||
edit->attrs_ok = (mc_fgetflags (arg->file_vpath, &edit->attrs) == 0);
|
||||
else
|
||||
edit->attrs_ok = FALSE;
|
||||
|
||||
edit->over_col = 0;
|
||||
edit->bracket = -1;
|
||||
|
|
Loading…
Reference in New Issue