]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #299 in SNORT/snort3 from last_token_fix to master
authorRuss Combs (rucombs) <rucombs@cisco.com>
Thu, 25 Feb 2016 22:46:47 +0000 (17:46 -0500)
committerRuss Combs (rucombs) <rucombs@cisco.com>
Thu, 25 Feb 2016 22:46:47 +0000 (17:46 -0500)
Squashed commit of the following:

commit 7bc5bd34da63da80ecd66283a97dbadcea520ece
Author: Tom Peters <thopeter@cisco.com>
Date:   Thu Feb 25 17:42:50 2016 -0500

    out of range fix

src/service_inspectors/nhttp_inspect/nhttp_normalizers.cc

index bfb1926594d6251f58706d5351f0e5d06b639dd1..e91f96c103d405aa0b30b9b151ec2d941f18529c 100644 (file)
@@ -82,8 +82,8 @@ int32_t norm_last_token_code(const Field& input, const StrCode table[])
 {
     assert(input.length > 0);
     const uint8_t* last_start;
-    for (last_start = input.start + input.length - 1; (*last_start != ',') &&
-        (last_start >= input.start); last_start--);
+    for (last_start = input.start + input.length - 1; (last_start >= input.start) &&
+        (*last_start != ','); last_start--);
     last_start++;
     const int32_t last_length = input.length - (last_start - input.start);
     return str_to_code(last_start, last_length, table);