From a205a0e9419f973346740171618956afe08b2d74 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Mon, 21 Mar 2022 09:06:35 -0400 Subject: [PATCH] Corrected a potential segfault condition on "extract" if a cellname contains slashes (which makes it look like a full path). --- VERSION | 2 +- extract/ExtCell.c | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/VERSION b/VERSION index 36621de1..f6f6ea20 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.3.277 +8.3.278 diff --git a/extract/ExtCell.c b/extract/ExtCell.c index 4335c937..f441afe9 100644 --- a/extract/ExtCell.c +++ b/extract/ExtCell.c @@ -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));