Fix: fail when reading 0 byte event
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 26 Nov 2013 17:36:28 +0000 (12:36 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 21 Feb 2014 17:03:51 +0000 (12:03 -0500)
Rather than looping forever.

Fixes #685

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
formats/ctf/ctf.c

index 60d9c9f9459d159b7627c9e76927409eccd55272..9047b7c22eccb38fea4a4e917e37fab9c3905f2c 100644 (file)
@@ -548,6 +548,11 @@ int ctf_read_event(struct bt_stream_pos *ppos, struct ctf_stream_definition *str
                        goto error;
        }
 
+       if (pos->last_offset == pos->offset) {
+               fprintf(stderr, "[error] Invalid 0 byte event encountered.\n");
+               return -EINVAL;
+       }
+
        return 0;
 
 error:
This page took 0.025837 seconds and 4 git commands to generate.