Skip to content

Commit

Permalink
Add error handling for empty named type definitions in codadef
Browse files Browse the repository at this point in the history
  • Loading branch information
svniemeijer committed Jan 13, 2025
1 parent ac53a1b commit 5ee0dbd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libcoda/coda-definition-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,11 @@ static int get_named_type(parser_info *info, const char *id, coda_type **type)
}
}
*type = coda_product_class_get_named_type(info->product_class, id);
if (*type == NULL)
{
coda_set_error(CODA_ERROR_DATA_DEFINITION, "named type definition for '%s' is empty", id);
return -1;
}
(*type)->retain_count++;
return 0;
}
Expand Down

0 comments on commit 5ee0dbd

Please sign in to comment.