Dolda2000 GitWeb
/
ashd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5de3363
)
psendfile: Fixed crash when files cannot be opened.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Sat, 17 May 2014 00:32:25 +0000
(
02:32
+0200)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Sat, 17 May 2014 00:32:25 +0000
(
02:32
+0200)
src/psendfile.c
patch
|
blob
|
blame
|
history
diff --git
a/src/psendfile.c
b/src/psendfile.c
index
08cd1d2
..
f5c7fdd
100644
(file)
--- a/
src/psendfile.c
+++ b/
src/psendfile.c
@@
-238,7
+238,7
@@
static void serve(struct muth *muth, va_list args)
simpleerror2(out, 404, "Not Found", "The requested URL has no corresponding resource.");
goto out;
}
- if(((sfile = fopen(file, "r"))
< 0
) || fstat(fileno(sfile), &sb)) {
+ if(((sfile = fopen(file, "r"))
== NULL
) || fstat(fileno(sfile), &sb)) {
flog(LOG_ERR, "psendfile: could not stat input file %s: %s", file, strerror(errno));
simpleerror2(out, 500, "Internal Error", "The server could not access its own data.");
goto out;