Signed-off-by: Felix Fietkau <nbd@openwrt.org>
static void logread_fd_data_cb(struct ustream *s, int bytes)
{
while (true) {
static void logread_fd_data_cb(struct ustream *s, int bytes)
{
while (true) {
a = (void*) ustream_get_read_buf(s, &len);
a = (void*) ustream_get_read_buf(s, &len);
- if (len < sizeof(*a) || len < blob_len(a) + sizeof(*a))
+
+ cur_len = blob_len(a) + sizeof(*a);
+ if (len < cur_len)
+ break;
+
- ustream_consume(s, blob_len(a) + sizeof(*a));
+ ustream_consume(s, cur_len);
}
if (!log_follow)
uloop_end();
}
if (!log_follow)
uloop_end();