[cgmanager-devel] New Defects reported by Coverity Scan for cgmanager
scan-admin at coverity.com
scan-admin at coverity.com
Fri Apr 11 08:01:50 UTC 2014
Hi,
Please find the latest report on new defect(s) introduced to cgmanager found with Coverity Scan.
Defect(s) Reported-by: Coverity Scan
Showing 2 of 2 defect(s)
** CID 1199695: Incorrect sizeof expression (BAD_SIZEOF)
/frontend.c: 56 in timer_hash_fn()
** CID 1199694: Operands don't affect result (CONSTANT_EXPRESSION_RESULT)
/frontend.c: 57 in timer_hash_fn()
________________________________________________________________________________________________________
*** CID 1199695: Incorrect sizeof expression (BAD_SIZEOF)
/frontend.c: 56 in timer_hash_fn()
50 }
51
52 static uint32_t timer_hash_fn(const void *conn)
53 {
54 unsigned long val = (unsigned long)conn;
55
>>> CID 1199695: Incorrect sizeof expression (BAD_SIZEOF)
>>> Taking the size of pointer parameter "conn" is suspicious.
56 if (sizeof(conn) > 4)
57 val ^= (val >> 32);
58 return (uint32_t)val;
59 }
60
61 static int timer_cmp_fn(const void *v1, const void *v2)
________________________________________________________________________________________________________
*** CID 1199694: Operands don't affect result (CONSTANT_EXPRESSION_RESULT)
/frontend.c: 57 in timer_hash_fn()
51
52 static uint32_t timer_hash_fn(const void *conn)
53 {
54 unsigned long val = (unsigned long)conn;
55
56 if (sizeof(conn) > 4)
>>> CID 1199694: Operands don't affect result (CONSTANT_EXPRESSION_RESULT)
>>> val >> 32 is 0 regardless of the values of its operands. This occurs as the bitwise operand of '^='.
57 val ^= (val >> 32);
58 return (uint32_t)val;
59 }
60
61 static int timer_cmp_fn(const void *v1, const void *v2)
62 {
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, http://scan.coverity.com/projects/1082?tab=Overview
To unsubscribe from the email notification for new defects, http://scan5.coverity.com/cgi-bin/unsubscribe.py
More information about the cgmanager-devel
mailing list