src/runmode-dpdk.c:202:11: warning: Size of pointer 'argv' used instead of size of its data. This is likely to lead to a buffer overflow. You probably intend to write 'sizeof(*argv)'. [pointerSize]
args->argv = SCCalloc(capacity, sizeof(args->argv));
^
src/runmode-dpdk.c:777:23: error: Shifting 32-bit value by 63 bits is undefined behaviour [shiftTooManyBits]
if (bits & (1 << i))
^
src/runmode-dpdk.c:776:23: note: Assuming that condition 'i<64' is not redundant
for (int i = 0; i < 64; i++) {
^
src/runmode-dpdk.c:777:23: note: Shift
if (bits & (1 << i))
^
static void ArgumentsInit(struct Arguments *args, unsigned capacity)
{
SCEnter();
- args->argv = SCCalloc(capacity, sizeof(args->argv));
+ args->argv = SCCalloc(capacity, sizeof(ptrdiff_t)); // alloc array of pointers
if (args->argv == NULL)
FatalError(SC_ERR_MEM_ALLOC, "Could not allocate memory for Arguments structure");
// Returns -1 if no bit is set
static int GetFirstSetBitPosition(uint64_t bits)
{
- for (int i = 0; i < 64; i++) {
- if (bits & (1 << i))
+ for (uint64_t i = 0; i < 64; i++) {
+ if (bits & BIT_U64(i))
return i;
}
return -1;