diff options
author | Bill Meier <wmeier@newsguy.com> | 2011-02-25 00:15:34 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2011-02-25 00:15:34 +0000 |
commit | 60817fb9a1725a48abe22de9fcb0537d118e3e1b (patch) | |
tree | 0556a8fba61c4de6f491896053edfe16ec0ad2be /wiretap/lanalyzer.c | |
parent | a62a37fbbe2510d826474dd416e2e490a781ae85 (diff) |
Fix Bug #5698: "Potential access violation when writing to LANalyzer files"
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5698
Note: before fix
File ! SaveAs in Lanalyzer format crashed quite consistently on Windows.
svn path=/trunk/; revision=36059
Diffstat (limited to 'wiretap/lanalyzer.c')
-rw-r--r-- | wiretap/lanalyzer.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/wiretap/lanalyzer.c b/wiretap/lanalyzer.c index 76d19767b8..7074c7b1ee 100644 --- a/wiretap/lanalyzer.c +++ b/wiretap/lanalyzer.c @@ -653,7 +653,8 @@ gboolean lanalyzer_dump_open(wtap_dumper *wdh, gboolean cant_seek, int *err) static gboolean lanalyzer_dump_header(wtap_dumper *wdh, int *err) { LA_TmpInfo *itmp = (LA_TmpInfo*)(wdh->priv); - struct tm *fT = localtime( (time_t *) &(itmp->start.tv_sec)); + time_t start_time = (time_t)itmp->start.tv_sec; + struct tm *fT = localtime(&start_time); /* XXX: OK to assume start_time is valid so fT won't be NULL ? */ guint16 board_type = itmp->encap == WTAP_ENCAP_TOKEN_RING ? BOARD_325TR /* LANalyzer Board Type */ : BOARD_325; /* LANalyzer Board Type */ |