Explorar o código

Fixed segmentation fault when JSON-RPC request cannot be parsed or is
invalid.

Tatsuhiro Tsujikawa %!s(int64=14) %!d(string=hai) anos
pai
achega
dfdf98d2f7
Modificáronse 1 ficheiros con 2 adicións e 3 borrados
  1. 2 3
      src/HttpServerBodyCommand.cc

+ 2 - 3
src/HttpServerBodyCommand.cc

@@ -232,8 +232,7 @@ bool HttpServerBodyCommand::execute()
                    getCuid()),
                e);
             rpc::RpcResponse res
-              (createJsonRpcErrorResponse
-               (-32700, "Parse error.", SharedHandle<ValueBase>()));
+              (createJsonRpcErrorResponse(-32700, "Parse error.", Null::g()));
             sendJsonRpcResponse(res, callback);
             return true;
           }
@@ -258,7 +257,7 @@ bool HttpServerBodyCommand::execute()
             } else {
               rpc::RpcResponse res
                 (createJsonRpcErrorResponse
-                 (-32600, "Invalid Request.", SharedHandle<ValueBase>()));
+                 (-32600, "Invalid Request.", Null::g()));
               sendJsonRpcResponse(res, callback);
             }
           }