Redirects used to initialize a chunk whose size was not set (0).
Also, the return code of chunk_strcpy() is 1 in case of success.
ret = !ret;
if (ret) {
- struct chunk rdr = { trash, 0 };
+ struct chunk rdr = { .str = trash, .size = sizeof(trash), .len = 0 };
const char *msg_fmt;
/* build redirect message */
break;
}
- if (unlikely(chunk_strcpy(&rdr, msg_fmt)))
+ if (unlikely(!chunk_strcpy(&rdr, msg_fmt)))
goto return_bad_req;
switch(rule->type) {