Describe the bug
There is a substring matching bug when EDS datasheet using a substring match of the table name with the EDS app and type name.
Specifically, this uses strncasecmp() to match the app name first, as a prefix to the type name. The problem is that it doesn't check that the following char is a separator, thus app names that are a substring of one another become ambiguous and can be incorrectly matched.
For example - the identifier "SCH_LAB_ScheduleTable_t' may match the datasheet for "SC" because SC is a substring of SCH_LAB.
To Reproduce
Generate tables in a configuration containing both SC and SCH_LAB apps. The tables for SCH_LAB may get incorrectly associated with SC datasheet and fail to build as a result.
Expected behavior
Should not match SCH to SC.
System observed on:
Debian
Additional context
As a simple fix, just confirm that the next char is a separator (e.g. _ or end-of-string) which will avoid matching SC to SCH_LAB.
Reporter Info
Joseph Hickey, Vantage Systems, Inc.
Describe the bug There is a substring matching bug when EDS datasheet using a substring match of the table name with the EDS app and type name.
Specifically, this uses
strncasecmp()
to match the app name first, as a prefix to the type name. The problem is that it doesn't check that the following char is a separator, thus app names that are a substring of one another become ambiguous and can be incorrectly matched.For example - the identifier "SCH_LAB_ScheduleTable_t' may match the datasheet for "SC" because SC is a substring of SCH_LAB.
To Reproduce Generate tables in a configuration containing both SC and SCH_LAB apps. The tables for SCH_LAB may get incorrectly associated with SC datasheet and fail to build as a result.
Expected behavior Should not match SCH to SC.
System observed on: Debian
Additional context As a simple fix, just confirm that the next char is a separator (e.g.
_
or end-of-string) which will avoid matching SC to SCH_LAB.Reporter Info Joseph Hickey, Vantage Systems, Inc.