]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Pull request #4823: Appid: Rpc exception handling
authorDaniil Kolomiiets -X (dkolomii - SOFTSERVE INC at Cisco) <dkolomii@cisco.com>
Thu, 24 Jul 2025 21:55:28 +0000 (21:55 +0000)
committerChris Sherwin (chsherwi) <chsherwi@cisco.com>
Thu, 24 Jul 2025 21:55:28 +0000 (21:55 +0000)
Merge in SNORT/snort3 from ~DKOLOMII/snort3:rpc_exception_handling to master

Squashed commit of the following:

commit ffafe7bfa059888acb7b4d794ab7496dccdf9490
Author: Daniil Kolomiiets <dkolomii@cisco.com>
Date:   Wed Jul 23 06:45:44 2025 -0400

    appid: prevent out_of_range and invalid_argument in rpc

src/network_inspectors/appid/service_plugins/service_rpc.cc

index aae5685b840de812a4f2d62cedc5cdf5b2c34c62..6d55ba0e6d5cf04c1c9ac04f8c588a0b6238288b 100644 (file)
@@ -329,7 +329,7 @@ static bool  validate_and_parse_universal_address(string& data, uint32_t &addres
     string tok;
     while (getline(tokenizer, tok, '.'))
     {
-        if (!all_of(tok.begin(), tok.end(), ::isdigit))
+        if (!all_of(tok.begin(), tok.end(), ::isdigit) || tok.length() > 3 || tok.empty())
             return false;
         int tmp = stoi(tok);
         if (tmp > 255)