Fix: consumer snapshot: handle unsigned long overflow
[lttng-tools.git] / src / common / ust-consumer / ust-consumer.c
index 46f330052aa8c04fdd440b6f4dd30485634678c5..94b761cb8fc19fa532b4a485c178b4ac93aaee54 100644 (file)
@@ -1168,7 +1168,7 @@ static int snapshot_channel(struct lttng_consumer_channel *channel,
                                produced_pos, nb_packets_per_stream,
                                stream->max_sb_size);
 
-               while (consumed_pos < produced_pos) {
+               while ((long) (consumed_pos - produced_pos) < 0) {
                        ssize_t read_len;
                        unsigned long len, padded_len;
 
This page took 0.025343 seconds and 5 git commands to generate.