Open xuyouming1986 opened 4 years ago
I'd recommend changing if (!res) return -1; to if (tlvP->value.asBuffer.length && !res) return -1;. when I get a chance I'll add test cases for empty strings for all formats and fix this on my version. I don't know when I'll be able to get it merged.
I already have fixed this in https://github.com/sbertin-telular/wakaama/tree/lwm2m_1.1. When pull requests start to be merged again I will submit my changes for merging also.
@sbertin-telular possible for you to submit the fix?
If this is urgent, go ahead and submit a fix. I don't remember exactly where that change is and my changes for LWM2M 1.1 tend to build on each other. I can deal with the conflict when I get to my change.
ok, it is not urgent. Just an ambition to reduce the number of open issues (bugs).
I found that , when my resource is an empty string, then wakaama process json serialization fails. Any way, string resource can be empty, right?
res = json_escapeString(buffer + head, bufferLen - head, tlvP->value.asBuffer.buffer, tlvP->value.asBuffer.length);
if (!res) return -1;