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.
|
SINGLE_TYPE_COMPARE(string, MAX_STRING_SIZE); |
with
|
#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. )
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 returnfalse.caPutLog/caPutLogApp/caPutJsonLogTask.cpp
Line 834 in 51a6c1e
with
caPutLog/caPutLogApp/caPutJsonLogTask.cpp
Lines 797 to 800 in 51a6c1e
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. )