Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-commits: [Wireshark-commits] rev 42865: /trunk/wiretap/ /trunk/wiretap/: vwr.c

Date: Sun, 27 May 2012 20:40:09 GMT
http://anonsvn.wireshark.org/viewvc/viewvc.cgi?view=rev&revision=42865

User: guy
Date: 2012/05/27 01:40 PM

Log:
 vwr_read_rec_header()'s return value is used only to distinguish success
 (read a record header) from failure (got an EOF or an error).  Make it
 just return a Boolean.
 
 If it fails in vwr_read(), don't overwrite *err_info (yes,
 vwr_read_rec_header() might have set *err_info, so don't lose - and
 leak! - the value it returned) - trust vwr_read_rec_header(), or the
 routines it calls, to have set it.  (If there's a code path where that
 doesn't happen, that code path needs to be fixed; the setting of
 *err_info in vwr_read() should *not* be restored.)
 
 Thanks to Evan Huus for finding a useless variable with cppcheck, and
 reporting it in bug 7295, provoking me to look at this.

Directory: /trunk/wiretap/
  Changes    Path          Action
  +9 -16     vwr.c         Modified