diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2000-11-19 03:47:36 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2000-11-19 03:47:36 +0000 |
commit | 8e27b1863e9a2ec683d22b13dd1f37c6a7f02c7c (patch) | |
tree | a05660c64ec8ec13efb3259cb9df89693d13ddf0 /wiretap/i4btrace.c | |
parent | d5706016f299b0737c13d77abef33937fe0c61b3 (diff) |
"wtap_read()" must *always* set "*err" when it returns FALSE - if it's
just an EOF, it should set "*err" to 0. Fix up a bunch of read routines
for various capture file types to set "*err" appropriately.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2667 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'wiretap/i4btrace.c')
-rw-r--r-- | wiretap/i4btrace.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/wiretap/i4btrace.c b/wiretap/i4btrace.c index 52f4fb53c7..736a211c6f 100644 --- a/wiretap/i4btrace.c +++ b/wiretap/i4btrace.c @@ -1,6 +1,6 @@ /* i4btrace.c * - * $Id: i4btrace.c,v 1.12 2000/11/17 21:00:40 gram Exp $ + * $Id: i4btrace.c,v 1.13 2000/11/19 03:47:35 guy Exp $ * * Wiretap Library * Copyright (c) 1999 by Bert Driehuis <driehuis@playbeing.org> @@ -130,9 +130,11 @@ static gboolean i4btrace_read(wtap *wth, int *err, int *data_offset) } wth->data_offset += sizeof hdr; i4b_byte_swap_header(wth, &hdr); - length = hdr.length - sizeof(hdr); - if (length == 0) + if (hdr.length < sizeof(hdr)) { + *err = WTAP_ERR_BAD_RECORD; /* record length < header! */ return FALSE; + } + length = hdr.length - sizeof(hdr); wth->phdr.len = length; wth->phdr.caplen = length; |