Commit 54299958 authored by Rusty Russell's avatar Rusty Russell

Fix grab_file on other than regular files.

parent 822bce88
......@@ -17,7 +17,7 @@ void *grab_fd(const void *ctx, int fd, size_t *size)
size = &s;
*size = 0;
if (fstat(fd, &st) == 0)
if (fstat(fd, &st) == 0 && S_ISREG(st.st_mode))
max = st.st_size;
else
max = 16384;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment