Change #262262
| Category | tcpdump |
| Changed by | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> |
| Changed at | Wed 25 Mar 2026 08:57:10 |
| Repository | https://git.tcpdump.org/tcpdump |
| Project | tcpdump |
| Branch | master |
| Revision | 32c6185b4569ef743bdacb5fd138c8ad63f09827 |
Comments
tcpdump: Fix a warning about use of a possibly-NULL pointer
Found with GCC option -fanalyzer.
The error was:
tcpdump.c: In function 'main':
tcpdump.c:1665:20: warning: use of possibly-NULL 'program_name' where
non-null expected [CWE-690] [-Wanalyzer-possible-null-argument]
1665 | last_dot = strrchr(program_name, '.');
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
[...]
In file included from ../libpcap/pcap/pcap-inttypes.h:98,
from netdissect-stdinc.h:78,
from tcpdump.c:41:
/usr/include/string.h:273:14: note: argument 1 of 'strrchr' must be
non-null
273 | extern char *strrchr (const char *__s, int __c)
| ^~~~~~~
Changed files
- tcpdump.c