diff --git a/util/tube.c b/util/tube.c index dc6e3c2e7..8ff474b87 100644 --- a/util/tube.c +++ b/util/tube.c @@ -363,7 +363,11 @@ int tube_read_msg(struct tube* tube, uint8_t** buf, uint32_t* len, } d += r; } - log_assert(*len < 65536*2); + if (*len >= 65536*2) { + log_err("tube msg length is too big", *len); + (void)fd_set_nonblock(fd); + return 0; + } *buf = (uint8_t*)malloc(*len); if(!*buf) { log_err("tube read out of memory");