Browse Source

Handle numbers which have 0 for 32 least significant bits

Caleb James DeLisle 5 years ago
parent
commit
631462e155
1 changed files with 5 additions and 1 deletions
  1. 5 1
      subnode/MsgCore.c

+ 5 - 1
subnode/MsgCore.c

@@ -302,11 +302,15 @@ static Iface_DEFUN incoming(struct Message* msg, struct Iface* interRouterIf)
     }
 
     int64_t* verP = Dict_getIntC(content, "p");
-    if (!verP || !*verP) {
+    if (!verP) {
         Log_debug(mcp->log, "DROP Message without version");
         return NULL;
     }
     addr.protocolVersion = *verP;
+    if (!addr.protocolVersion) {
+        Log_debug(mcp->log, "DROP Message with zero version");
+        return NULL;
+    }
 
     String* q = Dict_getStringC(content, "q");