This can now be done safely since we don't rely on message boundaries
anymore.
return sizeof(struct hmsg_header) - *input_len;
}
hdr = (struct hmsg_header *)*input_buffer;
- if (hdr->len > (1<<15)) {
+ if (hdr->len > HMSG_MAX_SIZE) {
LLOG_WARNX("message received is too large");
/* We discard the whole buffer */
free(*input_buffer);
enum hmsg_type type;
size_t len;
};
+#define HMSG_MAX_SIZE (1<<19)
/* ctl.c */
int ctl_create(char *);
LLOG_WARNX("not able to read header");
return;
}
- if (hdr.len > (1<<15)) {
+ if (hdr.len > HMSG_MAX_SIZE) {
LLOG_WARNX("message received is too large");
goto recv_error;
}