Add missing permission notice in each source file
[babeltrace.git] / formats / ctf / ctf.c
index 8029512a2745876f9ce19e9ce1fab725fb64ddf7..18a560132582ac9002535658734b51cb3abe68e8 100644 (file)
  *
  * The above copyright notice and this permission notice shall be included in
  * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
  */
 
 #include <babeltrace/format.h>
@@ -902,6 +910,9 @@ int ctf_open_trace_metadata_packet_read(struct ctf_trace *td, FILE *in,
                        return -EINVAL;
        }
 
+       if ((header.content_size / CHAR_BIT) < header_sizeof(header))
+               return -EINVAL;
+
        toread = (header.content_size / CHAR_BIT) - header_sizeof(header);
 
        for (;;) {
This page took 0.022718 seconds and 4 git commands to generate.