Project

General

Profile

Actions

Bug #2963

open

scan-build warnings for pcap logging

Added by Victor Julien over 3 years ago. Updated over 3 years ago.

Status:
New
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 Task #3153: tracking: scan-build warningsNewOISF DevActions
Actions #1

Updated by Victor Julien over 3 years ago

  • Description updated (diff)
Actions #2

Updated by Andreas Herz over 3 years ago

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

Updated by Victor Julien about 3 years ago

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

Also available in: Atom PDF