[Oisf-devel] [COMMIT] OISF branch, master, updated. suricata-2.0-75-g9abf595

OISF Git noreply at openinfosecfoundation.org
Wed Apr 23 10:17:35 UTC 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "OISF".

The branch, master has been updated
       via  9abf5951220ac5e4e91555a9f384f16a8c2f272e (commit)
      from  1992a22769e214f22d4af379b452c3e58c8fcebc (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 9abf5951220ac5e4e91555a9f384f16a8c2f272e
Author: Victor Julien <victor at inliniac.net>
Date:   Wed Apr 23 11:00:02 2014 +0200

    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.

-----------------------------------------------------------------------

Summary of changes:
 src/util-rohash.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
OISF


More information about the Oisf-devel mailing list