check for len(reqbuf) = 0
Probably never the case, but we want to cleanly catch this error instead of bringing up a segfault with reqbuf[-1].
This commit is contained in:
parent
72d02aa5b1
commit
67750f916f
1 changed files with 1 additions and 1 deletions
2
quark.c
2
quark.c
|
@ -273,7 +273,7 @@ responsedir(void) {
|
|||
size_t len = strlen(reqbuf);
|
||||
DIR *d;
|
||||
|
||||
if ((reqbuf[len - 1] != '/') && (len + 1 < MAXBUFLEN)) {
|
||||
if (len && (reqbuf[len - 1] != '/') && (len + 1 < MAXBUFLEN)) {
|
||||
/* add directory terminator if necessary */
|
||||
reqbuf[len] = '/';
|
||||
reqbuf[len + 1] = 0;
|
||||
|
|
Loading…
Reference in a new issue