aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2011-02-16 02:21:31 +0000
committerGuy Harris <guy@alum.mit.edu>2011-02-16 02:21:31 +0000
commit965ecf3056f69e7a6153c453a0c31819718db40b (patch)
treee92fef348e08759d71a50b962e2e86dbfba2ef80 /wiretap
parent59f65ab8153aaa6d8e135249e4730fe04388a089 (diff)
Return an error value for the new error return; it "can't happen" (but
either the VC++ analyzer can't determine that or it *can*, in fact, happen). Pick an error code that's not too far off. svn path=/trunk/; revision=35957
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/ngsniffer.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/wiretap/ngsniffer.c b/wiretap/ngsniffer.c
index cd9698f0ee..6c54d15ec9 100644
--- a/wiretap/ngsniffer.c
+++ b/wiretap/ngsniffer.c
@@ -2463,8 +2463,14 @@ ng_file_read(void *buffer, size_t elementsize, size_t numelements, wtap *wth,
if (is_random) {
/* Move to the next blob in the list. */
ngsniffer->current_blob = g_list_next(ngsniffer->current_blob);
- if (!ngsniffer->current_blob)
+ if (!ngsniffer->current_blob) {
+ /*
+ * XXX - this "can't happen"; we should have a
+ * blob for every byte in the file.
+ */
+ *err = WTAP_ERR_CANT_SEEK;
return -1;
+ }
blob = ngsniffer->current_blob->data;
} else {
/* If we also have a random stream open, add a new element,