aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-03-28 19:29:44 -0700
committerGuy Harris <guy@alum.mit.edu>2017-03-29 02:31:07 +0000
commit6b0f846ac35a9775090f85a02f58064b4b0117e6 (patch)
treeb63cb36ce27efcd688d53d024584fb3364bfe856 /wiretap
parent630b5a8165aab25d99989916f36412a0414068be (diff)
Fix problem found by Coverity.
The loop was using bytes_read, but wasn't setting it. Go back to something similar to the previous loop condition, but don't lose the error tests. Fixes Coverity CID 1403388. Change-Id: I557cbfa6e9ad81491af4fc90e85ce87c71fec8aa Reviewed-on: https://code.wireshark.org/review/20776 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/netscaler.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/wiretap/netscaler.c b/wiretap/netscaler.c
index 0840a2c8b2..6aa6781421 100644
--- a/wiretap/netscaler.c
+++ b/wiretap/netscaler.c
@@ -1518,8 +1518,12 @@ static gboolean nstrace_read_v30(wtap *wth, int *err, gchar **err_info, gint64 *
nstrace_buf_offset = 0;
nstrace->xxx_offset += nstrace_buflen;
nstrace_buflen = NSPR_PAGESIZE_TRACE;
- } while((nstrace_buflen > 0) && (nstrace_read_buf(wth->fh, nstrace_buf, nstrace_buflen, err, err_info)));
+ } while((nstrace_buflen > 0) && (bytes_read = file_read(nstrace_buf, nstrace_buflen, wth->fh)) > 0 && (file_eof(wth->fh) || (guint32)bytes_read == nstrace_buflen));
+ if (bytes_read < 0)
+ *err = file_error(wth->fh, err_info);
+ else
+ *err = 0;
g_free(nstrace_tmpbuff);
return FALSE;
}