Commit da4c7df1 authored by Bernhard Link's avatar Bernhard Link

handling dsc parse errors: fix FILE given to unlink, check for file open error

parent 6dcafe6c
......@@ -601,16 +601,19 @@ unc_ok:
close(tmpfd);
tmp_file = fopen( tmp_filename, "r" );
while ( fgets( password_line, 999, tmp_file) )
if (tmp_file)
{
if (strstr(password_line,"This file requires a password for access."))
found = 1;
if (strstr(password_line,"Password did not work."))
found = 1;
}
fclose(tmp_file);
unlink((char*) tmp_file);
while ( fgets( password_line, 999, tmp_file) )
{
if (strstr(password_line,"This file requires a password for access."))
found = 1;
if (strstr(password_line,"Password did not work."))
found = 1;
}
fclose(tmp_file);
unlink(tmp_filename);
}
if (found)
{
cb_askPassword((Widget)NULL, NULL, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment