Project

General

Profile

Actions

Bug #2963

closed

scan-build warnings for pcap logging

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       log-pcap.o
log-pcap.c:766:31: warning: The third argument allows to potentially copy more bytes than it should. Replace with the value sizeof(pattern) or lower
        strlcat(pattern, "/", PATH_MAX);
                              ^~~~~~~~
/usr/include/linux/limits.h:13:25: note: expanded from macro 'PATH_MAX'
#define PATH_MAX        4096    /* # chars in a path name including nul */
                        ^~~~
log-pcap.c:775:40: warning: The third argument allows to potentially copy more bytes than it should. Replace with the value sizeof(pattern) or lower
                strlcat(pattern, part, PATH_MAX);
                                       ^~~~~~~~
/usr/include/linux/limits.h:13:25: note: expanded from macro 'PATH_MAX'
#define PATH_MAX        4096    /* # chars in a path name including nul */
                        ^~~~
log-pcap.c:786:43: warning: The third argument allows to potentially copy more bytes than it should. Replace with the value sizeof(pattern) or lower
                    strlcat(pattern, tmp, PATH_MAX);
                                          ^~~~~~~~
/usr/include/linux/limits.h:13:25: note: expanded from macro 'PATH_MAX'
#define PATH_MAX        4096    /* # chars in a path name including nul */
                        ^~~~
log-pcap.c:790:43: warning: The third argument allows to potentially copy more bytes than it should. Replace with the value sizeof(pattern) or lower
                    strlcat(pattern, "*", PATH_MAX);
                                          ^~~~~~~~
/usr/include/linux/limits.h:13:25: note: expanded from macro 'PATH_MAX'
#define PATH_MAX        4096    /* # chars in a path name including nul */
                        ^~~~
log-pcap.c:799:38: warning: The third argument allows to potentially copy more bytes than it should. Replace with the value sizeof(pattern) or lower
        strlcat(pattern, pl->prefix, PATH_MAX);
                                     ^~~~~~~~
/usr/include/linux/limits.h:13:25: note: expanded from macro 'PATH_MAX'
#define PATH_MAX        4096    /* # chars in a path name including nul */
                        ^~~~
log-pcap.c:800:32: warning: The third argument allows to potentially copy more bytes than it should. Replace with the value sizeof(pattern) or lower
        strlcat(pattern, ".*", PATH_MAX);
                               ^~~~~~~~
/usr/include/linux/limits.h:13:25: note: expanded from macro 'PATH_MAX'
#define PATH_MAX        4096    /* # chars in a path name including nul */
                        ^~~~
log-pcap.c:802:34: warning: The third argument allows to potentially copy more bytes than it should. Replace with the value sizeof(pattern) or lower
    strlcat(pattern, pl->suffix, PATH_MAX);
                                 ^~~~~~~~
/usr/include/linux/limits.h:13:25: note: expanded from macro 'PATH_MAX'
#define PATH_MAX        4096    /* # chars in a path name including nul */
                        ^~~~
7 warnings generated.

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

  • Description updated (diff)
Actions #2

Updated by Andreas Herz over 5 years ago

  • Assignee set to OISF Dev
  • Target version set to TBD
Actions #3

Updated by Victor Julien over 5 years ago

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

Updated by Victor Julien over 1 year ago

  • Status changed from New to Closed
  • Assignee deleted (OISF Dev)
  • Target version deleted (TBD)

Warning doesn't appear anymore.

Actions

Also available in: Atom PDF