summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/imlib.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/imlib.c b/src/imlib.c
index ac7e667..c44e644 100644
--- a/src/imlib.c
+++ b/src/imlib.c
@@ -254,9 +254,13 @@ char *feh_http_load_image(char *url)
weprintf("open url: libcurl initialization failure");
return NULL;
}
+
+ if (strlen(tmpname) > (NAME_MAX-6))
+ tmpname[NAME_MAX-7] = '\0';
sfn = estrjoin("_", tmpname, "XXXXXX", NULL);
free(tmpname);
+
fd = mkstemp(sfn);
if (fd != -1) {
sfp = fdopen(fd, "w+");