Suricata is a network Intrusion Detection System, Intrusion Prevention System and Network Security Monitoring engine developed by the OISF and the Suricata community.
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Go to file
Victor Julien 9abf595122 rohash: fix potential bad shift
Fix issue detected byCoverity:

*** CID 1197756:  Bad bit shift operation  (BAD_SHIFT)
/src/util-rohash.c: 74 in ROHashInit()
68         }
69         if (hash_bits < 4 || hash_bits > 32) {
70             SCLogError(SC_ERR_HASH_TABLE_INIT, "invalid hash_bits setting, valid range is 4-32");
71             return NULL;
72         }
73
>>>     CID 1197756:  Bad bit shift operation  (BAD_SHIFT)
>>>     In expression "1U << hash_bits", left shifting by more than 31 bits has undefined behavior.  The shift amount, "hash_bits", is as much as 32.
74         uint32_t size = hashsize(hash_bits) * sizeof(ROHashTableOffsets);
75
76         ROHashTable *table = SCMalloc(sizeof(ROHashTable) + size);
77         if (unlikely(table == NULL)) {
78             SCLogError(SC_ERR_HASH_TABLE_INIT, "failed to alloc memory");
79             return NULL;

This was only a potential issue as ROHashInit was only called with
hash_bits 16 in the code.

Bug #1170.
12 years ago
benches
contrib Add option on Tile-Gx for logging for fast.log alerts over PCIe 12 years ago
doc Update docs from wiki 13 years ago
m4
qa drmemory: remove bug 978 suppression 12 years ago
rules TLS: add detection for malicious heartbeats (AKA heartbleed) 12 years ago
scripts suricatasc: fix make distcheck. 13 years ago
src rohash: fix potential bad shift 12 years ago
.gitignore unittest: make check use a qa/log dir for logging 12 years ago
COPYING
ChangeLog Update Changelog for 2.0 release 12 years ago
LICENSE
Makefile.am make install-full: get correct version of ET 12 years ago
Makefile.cvs
acsite.m4
autogen.sh OpenBSD 5.2 build fixes, Unit test fix. 13 years ago
classification.config
config.rpath Add file needed for some autotools version. 12 years ago
configure.ac Change configure to allow statically linking libpcre. 12 years ago
doxygen.cfg doxygen: document all code 12 years ago
reference.config
suricata.yaml.in app-layer: proto detection update 12 years ago
threshold.config