mengnankkkk opened a new issue, #3811: URL: https://github.com/apache/hertzbeat/issues/3811
### Is there an existing issue for this? - [x] I have searched the existing issues ### Current Behavior There is a critical stream synchronization issue in parseLabelValue If: Input: label="\xC0\x80value" Read 0xC0 and call handleUtf8Character(0xC0, ...) calculateUtf8ContinuationBytes(0xC0) returns -1 (illegal) Append \uFFFD and return directly Key issue: i = inputStream.read() at the end of the loop continues execution 0x80 is read, but this byte has "lost" its UTF-8 context 0x80 is treated as an ASCII character (because it is <127 which is false, it =128) The final result is wrong ### Expected Behavior Even if illegal characters are encountered, they can still be parsed correctly. ### Steps To Reproduce _No response_ ### Environment ```markdown HertzBeat version(s): ``` ### Debug logs _No response_ ### Anything else? _No response_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
