Fix: missing check of ftell error
[babeltrace.git] / plugins / ctf / common / metadata / decoder.c
index b6d3e48473ddf707bc30bbbf89b5a917b6539039..cba4756c07d9ce34ccd85535006be8cd08d19be5 100644 (file)
@@ -431,6 +431,12 @@ enum ctf_metadata_decoder_status ctf_metadata_decoder_decode(
 
                BT_LOGD("Metadata stream is plain text: mdec-addr=%p", mdec);
 
+               if (init_pos < 0) {
+                       BT_LOGE_ERRNO("Failed to get current file position", ".");
+                       status = CTF_METADATA_DECODER_STATUS_ERROR;
+                       goto end;
+               }
+
                /* Check text-only metadata header and version */
                nr_items = fscanf(fp, "/* CTF %10u.%10u", &major, &minor);
                if (nr_items < 2) {
This page took 0.023765 seconds and 4 git commands to generate.