Преглед изворни кода

Fixed use-of-uninitialized-value in encodeCodepoint()

Benoit Blanchon пре 5 година
родитељ
комит
96b6571352
1 измењених фајлова са 2 додато и 0 уклоњено
  1. 2 0
      src/ArduinoJson/Json/Utf16.hpp

+ 2 - 0
src/ArduinoJson/Json/Utf16.hpp

@@ -31,6 +31,8 @@ inline bool isLowSurrogate(uint16_t codeunit) {
 
 class Codepoint {
  public:
+  Codepoint() : _highSurrogate(0) {}
+
   bool append(uint16_t codeunit) {
     if (isHighSurrogate(codeunit)) {
       _highSurrogate = codeunit & 0x3FF;