diff --git a/src/files.c b/src/files.c index a974e65c..3f8b5293 100644 --- a/src/files.c +++ b/src/files.c @@ -1467,7 +1467,7 @@ char *safe_tempfile(FILE **stream) extension = strrchr(openfile->filename, '.'); - if (!extension) + if (!extension || strchr(extension, '/')) extension = openfile->filename + strlen(openfile->filename); tempfile_name = nrealloc(tempdir, strlen(tempdir) + 12 + strlen(extension));