Add missing EOF check in string validation
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 7 May 2011 07:01:38 +0000 (03:01 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 7 May 2011 07:01:38 +0000 (03:01 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
formats/ctf/types/string.c

index 4ab305249b7d096c50cc9cdf2db1b011010067f5..a8f75a976a00dc7a08733dc252dd7a0243d07a30 100644 (file)
@@ -35,6 +35,8 @@ int ctf_string_read(struct stream_pos *ppos, struct definition *definition)
        ctf_align_pos(pos, string_declaration->p.alignment);
 
        srcaddr = ctf_get_pos_addr(pos);
+       if (pos->offset == -EOF)
+               return -EFAULT;
        /* Not counting \0 */
        max_len = pos->packet_size - pos->offset - 1;
        if (max_len < 0)
This page took 0.023622 seconds and 4 git commands to generate.