* src/url.c (append_uri_pathel): Check for possible NULL dereference

This commit is contained in:
Tim Rühsen 2019-05-06 16:14:40 +02:00
parent 7da620c7ce
commit fac8f8099d

View File

@ -1463,14 +1463,18 @@ append_uri_pathel (const char *b, const char *e, bool escaped,
{ {
const char *p; const char *p;
int quoted, outlen; int quoted, outlen;
int mask; int mask;
if (!dest)
return;
if (opt.restrict_files_os == restrict_unix) if (opt.restrict_files_os == restrict_unix)
mask = filechr_not_unix; mask = filechr_not_unix;
else if (opt.restrict_files_os == restrict_vms) else if (opt.restrict_files_os == restrict_vms)
mask = filechr_not_vms; mask = filechr_not_vms;
else else
mask = filechr_not_windows; mask = filechr_not_windows;
if (opt.restrict_files_ctrl) if (opt.restrict_files_ctrl)
mask |= filechr_control; mask |= filechr_control;