Merge branch 'master' of ssh://efficios.com/home/efficios/git/babeltrace
[babeltrace.git] / formats / ctf / types / string.c
index 4ab305249b7d096c50cc9cdf2db1b011010067f5..682bd76d116b158e7b9577308040facaec1acd65 100644 (file)
@@ -3,7 +3,9 @@
  *
  * Strings read/write functions.
  *
- * Copyright 2010 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ * Copyright 2010-2011 EfficiOS Inc. and Linux Foundation
+ *
+ * Author: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
@@ -35,6 +37,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.023806 seconds and 4 git commands to generate.