aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorDavid Perry <boolean263@protonmail.com>2022-07-05 16:59:19 +0000
committerGerald Combs <gerald@wireshark.org>2022-07-05 16:59:19 +0000
commit82408922fd681b5a6ac47c6dd32fdef88efb2414 (patch)
treee9edd718af3b95f8eb0c9c00a5113f823a37189d /file.c
parent6684583c7ca814fbf8929abad16ae23e4c2e9f51 (diff)
Prevent null dereference in `rescan_file()`
Diffstat (limited to 'file.c')
-rw-r--r--file.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/file.c b/file.c
index 368084ef0f..8dfb30bb00 100644
--- a/file.c
+++ b/file.c
@@ -4591,7 +4591,9 @@ rescan_file(capture_file *cf, const char *fname, gboolean is_tempfile)
&data_offset))) {
framenum++;
fdata = frame_data_sequence_find(cf->provider.frames, framenum);
- fdata->file_off = data_offset;
+ if (G_LIKELY(fdata != NULL)) {
+ fdata->file_off = data_offset;
+ }
if (size >= 0) {
count++;
cf->f_datalen = wtap_read_so_far(cf->provider.wth);