diff options
author | Jaap Keuter <jaap.keuter@xs4all.nl> | 2019-09-04 21:56:27 +0200 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2019-09-04 20:18:29 +0000 |
commit | d58f8f57c110254a72b3329c457e748830808667 (patch) | |
tree | 7297f3918a41e559eccdd0a6e419b467b50fedce /wiretap/commview.c | |
parent | f45ed90a4f6cd9b0f0a128f4d0ff4863da491b0f (diff) | |
download | wireshark-d58f8f57c110254a72b3329c457e748830808667.tar.gz wireshark-d58f8f57c110254a72b3329c457e748830808667.tar.bz2 wireshark-d58f8f57c110254a72b3329c457e748830808667.zip |
Wiretap: Write commview files with valid headers
When writing a capture as a commview file the header written is two
bytes longer than the specification. Even though we count 24, we
actually write 26. This makes the commview file corrupt, as is apparent
when reading such file, eg., after using Save As... with this format.
Replace writing 2 bytes for the last two fields in the header by 1 byte
each, as per the header specification.
Change-Id: I9436f7837b2e3617a389619884bf93ad146e95f3
Reviewed-on: https://code.wireshark.org/review/34450
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap/commview.c')
-rw-r--r-- | wiretap/commview.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/wiretap/commview.c b/wiretap/commview.c index 17f67b5746..24a5e2fd63 100644 --- a/wiretap/commview.c +++ b/wiretap/commview.c @@ -585,9 +585,9 @@ static gboolean commview_dump(wtap_dumper *wdh, return FALSE; if (!wtap_dump_file_write(wdh, &cv_hdr.direction, 1, err)) return FALSE; - if (!wtap_dump_file_write(wdh, &cv_hdr.signal_level_dbm, 2, err)) + if (!wtap_dump_file_write(wdh, &cv_hdr.signal_level_dbm, 1, err)) return FALSE; - if (!wtap_dump_file_write(wdh, &cv_hdr.noise_level, 2, err)) + if (!wtap_dump_file_write(wdh, &cv_hdr.noise_level, 1, err)) return FALSE; wdh->bytes_dumped += COMMVIEW_HEADER_SIZE; |