Corrected a potential segfault condition on "extract" if a cellname
contains slashes (which makes it look like a full path).
This commit is contained in:
parent
d98645afc1
commit
a205a0e941
|
|
@ -208,14 +208,17 @@ extFileOpen(def, file, mode, doLocal, prealfile)
|
|||
else
|
||||
name = def->cd_name;
|
||||
|
||||
ends = strrchr(def->cd_file, '/');
|
||||
if (ends != NULL)
|
||||
if (def->cd_file)
|
||||
{
|
||||
testf = PaOpen(ends + 1, "r", ".mag", ".", ".", NULL);
|
||||
if (testf)
|
||||
ends = strrchr(def->cd_file, '/');
|
||||
if (ends != NULL)
|
||||
{
|
||||
fclose(testf);
|
||||
return NULL;
|
||||
testf = PaOpen(ends + 1, "r", ".mag", ".", ".", NULL);
|
||||
if (testf)
|
||||
{
|
||||
fclose(testf);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
return (PaOpen(name, mode, ".ext", ".", ".", prealfile));
|
||||
|
|
|
|||
Loading…
Reference in New Issue