diff options
author | Jeremy Sowden <jeremy@azazel.net> | 2023-03-16 11:07:54 +0000 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2023-03-16 23:24:55 +0100 |
commit | 524ce20b55a2793d380fc1e4b415b1ea5a9512b1 (patch) | |
tree | 649623c9d659f10b8f30b41b95f46e0b98d5eae1 /include | |
parent | 3994535c1d54028ae0a3268e001c9598c7c335ed (diff) |
pcap: prevent crashes when output `FILE *` is null
If ulogd2 receives a signal it will attempt to re-open the pcap output
file. If this fails (because the permissions or ownership have changed
for example), the FILE pointer will be null and when the next packet
comes in, the null pointer will be passed to fwrite and ulogd will
crash.
Instead, assign the return value of `fopen` to a local variable, and
only close the existing stream if `fopen` succeeded.
Link: https://bugs.launchpad.net/ubuntu/+source/ulogd2/+bug/1429778
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions