Prechádzať zdrojové kódy

Fix #590: Possible nullpointer in decode if invalid message

Stefan Profanter 9 rokov pred
rodič
commit
f80def1ff8
1 zmenil súbory, kde vykonal 4 pridanie a 0 odobranie
  1. 4 0
      src/server/ua_server_binary.c

+ 4 - 0
src/server/ua_server_binary.c

@@ -440,6 +440,10 @@ processMSG(UA_Connection *connection, UA_Server *server, const UA_ByteString *ms
         }
 
         return;
+    default:
+        UA_LOG_INFO(server->config.logger, UA_LOGCATEGORY_SECURECHANNEL,
+            "Received unknown message chunk: %c", msg->data[*pos - 24 + 3]);
+        return;
     }
 
     retval |= UA_NodeId_decodeBinary(&bytes, pos, &requestTypeId);