X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=formats%2Fctf%2Ftypes%2Fstring.c;h=197a7e135f276825ae9e29f85a70b20636755c13;hb=75847d0ab8f98b1bc982b25c8a6d86a5a7f4b2d7;hp=4ab305249b7d096c50cc9cdf2db1b011010067f5;hpb=c5e74408f9786219f6b44400dcf2098ab9cc78fb;p=babeltrace.git diff --git a/formats/ctf/types/string.c b/formats/ctf/types/string.c index 4ab30524..197a7e13 100644 --- a/formats/ctf/types/string.c +++ b/formats/ctf/types/string.c @@ -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)