-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Labels
jsonJSON format loggingJSON format logging
Description
When comparing old and new value (to decide if a change needs to be logged), the comparison for strings in the non-array case (where the value is actually a char[]) does not compare the strings, but their addresses and will always return false.
caPutLog/caPutLogApp/caPutJsonLogTask.cpp
Line 834 in 51a6c1e
| SINGLE_TYPE_COMPARE(string, MAX_STRING_SIZE); |
with
caPutLog/caPutLogApp/caPutJsonLogTask.cpp
Lines 797 to 800 in 51a6c1e
| #define SINGLE_TYPE_COMPARE(_t, _s) \ | |
| if (pLogData->is_array) \ | |
| return memcmp(pa->a_##_t, pb->a_##_t, size * _s) == 0; \ | |
| return pa->v_##_t == pb->v_##_t; |
This is not serious, as it only leads to string puts always triggering a log, i.e. additional log messages.
There is no test that would catch the faulty behavior. (Tests only check that changing data triggers log messages. )
Metadata
Metadata
Assignees
Labels
jsonJSON format loggingJSON format logging