[hackers] [quark] check for len(reqbuf) = 0 || FRIGN
commit 67750f916fdc0406f3ea9313993452d9148819e2
Author: FRIGN <dev_AT_frign.de>
Date: Thu Aug 14 13:58:36 2014 +0200
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].
diff --git a/quark.c b/quark.c
index 121ecee..4fb065d 100644
--- a/quark.c
+++ b/quark.c
_AT_@ -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;
Received on Thu Aug 14 2014 - 13:57:44 CEST
This archive was generated by hypermail 2.3.0
: Thu Aug 14 2014 - 14:00:13 CEST