You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by GitBox <gi...@apache.org> on 2022/06/23 12:35:48 UTC

[GitHub] [incubator-kvrocks] PragmaTwice commented on a diff in pull request #652: Fix Wrongly parsed the RESP empty/null array (#633)

PragmaTwice commented on code in PR #652:
URL: https://github.com/apache/incubator-kvrocks/pull/652#discussion_r904963891


##########
src/redis_request.cc:
##########
@@ -59,11 +59,15 @@ Status Request::Tokenize(evbuffer *input) {
         svr_->stats_.IncrInbondBytes(len);
         if (line[0] == '*') {
           try {
-            multi_bulk_len_ = std::stoull(std::string(line + 1, len-1));
+            multi_bulk_len_ = std::stoll(std::string(line + 1, len-1));
           } catch (std::exception &e) {
             free(line);
             return Status(Status::NotOK, "Protocol error: invalid multibulk length");
           }
+          if (multi_bulk_len_ <= 0) {

Review Comment:
   Is a `multi_bulk_len_ = 0` needed while `multi_bulk_len_ < 0` ?



-- 
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: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org