projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: unchecked return value of bt_ctf_field_type_get_field_at_index
[babeltrace.git]
/
lib
/
ctf-ir
/
field-types.c
diff --git
a/lib/ctf-ir/field-types.c
b/lib/ctf-ir/field-types.c
index 485c5e8f3ea71e2f68d6b84f62559af01c5a57e2..06d8c76717571d136e5d9e3a9d529125e6d5b830 100644
(file)
--- a/
lib/ctf-ir/field-types.c
+++ b/
lib/ctf-ir/field-types.c
@@
-5284,9
+5284,15
@@
struct bt_ctf_field_type *bt_ctf_field_type_get_field_at_index(
switch (type_id) {
case CTF_TYPE_STRUCT:
switch (type_id) {
case CTF_TYPE_STRUCT:
- bt_ctf_field_type_structure_get_field_by_index(field_type,
- NULL, &field, index);
+ {
+ int ret = bt_ctf_field_type_structure_get_field_by_index(
+ field_type, NULL, &field, index);
+ if (ret) {
+ field = NULL;
+ goto end;
+ }
break;
break;
+ }
case CTF_TYPE_VARIANT:
{
int ret = bt_ctf_field_type_variant_get_field_by_index(
case CTF_TYPE_VARIANT:
{
int ret = bt_ctf_field_type_variant_get_field_by_index(
This page took
0.02419 seconds
and
4
git commands to generate.