Explorar el Código

BencodeParser: fixed parser failure due to the uninitialized variables

Tatsuhiro Tsujikawa hace 13 años
padre
commit
7176107414
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      src/BencodeParser.cc

+ 3 - 0
src/BencodeParser.cc

@@ -135,7 +135,10 @@ ssize_t BencodeParser::parseUpdate(const char* data, size_t size)
       if(rv < 0) {
         return rv;
       }
+      strLength_ = 0;
+      numConsumed_ = 0;
       runBeginCallback(STRUCT_DICT_KEY_T);
+      currentState_ = BENCODE_STRING_LEN;
       // Fall through
     }
     case BENCODE_STRING_LEN: {