summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-10-24 14:13:45 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-10-24 14:13:45 +0200
commit021d0f975df35c52643bb6abca1c8a8459af1326 (patch)
treee12a8475b9d520636dbd1f92f09db22a766c3ec8 /src
parentc9a7b4d88e109e52a6395573336af7ac33b60baa (diff)
imlib.c: Fix too long mkstemp argument (debian #646421)
Diffstat (limited to 'src')
-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+");