]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
fix for #771. 315/head
authorAnoop Saldanha <anoopsaldanha@gmail.com>
Tue, 12 Mar 2013 03:04:33 +0000 (08:34 +0530)
committerAnoop Saldanha <anoopsaldanha@gmail.com>
Tue, 12 Mar 2013 03:04:34 +0000 (08:34 +0530)
Fix /etc/protocols parsing.  Remove trailing newspace stored under some cases.

src/util-proto-name.c

index 2d1ec2dc22e02da4641a23ccc4f0dfde5a141a4e..810d494098992047910e382740f40c2125382949 100644 (file)
@@ -76,6 +76,9 @@ void SCProtoNameInit()
             } else {
                 known_proto[proto] = SCStrdup(name);
             }
+            int proto_len = strlen(known_proto[proto]);
+            if (proto_len > 0 && known_proto[proto][proto_len - 1] == '\n')
+                known_proto[proto][proto_len - 1] = '\0';
         }
         fclose(fp);
     }