Project

General

Profile

Actions

Bug #3148

closed

scan-build warnings for ac implementations

Added by Victor Julien over 5 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

  CC       util-mpm-ac-bs.o
util-mpm-ac-bs.c:487:32: warning: Result of 'malloc' is converted to a pointer of type 'uint16_t [256]', which is incompatible with sizeof operand type 'uint16_t'
        ctx->state_table_u16 = SCMalloc(ctx->state_count *
                               ^~~~~~~~
./util-mem.h:37:18: note: expanded from macro 'SCMalloc'
#define SCMalloc malloc
                 ^~~~~~
util-mpm-ac-bs.c:528:32: warning: Result of 'malloc' is converted to a pointer of type 'uint32_t [256]', which is incompatible with sizeof operand type 'uint32_t'
        ctx->state_table_u32 = SCMalloc(ctx->state_count *
                               ^~~~~~~~
./util-mem.h:37:18: note: expanded from macro 'SCMalloc'
#define SCMalloc malloc
                 ^~~~~~
2 warnings generated.
  CC       util-mpm-ac.o
util-mpm-ac.c:571:32: warning: Result of 'malloc' is converted to a pointer of type 'uint16_t [256]', which is incompatible with sizeof operand type 'uint16_t'
        ctx->state_table_u16 = SCMalloc(ctx->state_count *
                               ^~~~~~~~
./util-mem.h:37:18: note: expanded from macro 'SCMalloc'
#define SCMalloc malloc
                 ^~~~~~
util-mpm-ac.c:614:32: warning: Result of 'malloc' is converted to a pointer of type 'uint32_t [256]', which is incompatible with sizeof operand type 'uint32_t'
        ctx->state_table_u32 = SCMalloc(ctx->state_count *
                               ^~~~~~~~
./util-mem.h:37:18: note: expanded from macro 'SCMalloc'
#define SCMalloc malloc
                 ^~~~~~
2 warnings generated.

Subtasks 1 (0 open1 closed)

Bug #6017: scan-build warnings for ac implementations (6.0.x backport)ClosedVictor JulienActions

Related issues 1 (1 open0 closed)

Related to Suricata - Task #3153: tracking: scan-build warningsIn ProgressVictor JulienActions
Actions #1

Updated by Victor Julien over 5 years ago

  • Related to Task #3153: tracking: scan-build warnings added
Actions #2

Updated by Victor Julien over 1 year ago

  • Status changed from New to In Progress
  • Assignee changed from OISF Dev to Victor Julien
  • Target version changed from TBD to 7.0.0-rc2
Actions #3

Updated by Victor Julien over 1 year ago

  • Status changed from In Progress to Resolved
  • Label Needs backport to 6.0 added
Actions #4

Updated by OISF Ticketbot over 1 year ago

  • Subtask #6017 added
Actions #5

Updated by OISF Ticketbot over 1 year ago

  • Label deleted (Needs backport to 6.0)
Actions #6

Updated by Victor Julien over 1 year ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF