diff options
author | Gerald Combs <gerald@wireshark.org> | 2006-03-09 20:48:17 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2006-03-09 20:48:17 +0000 |
commit | d910d8491be93dbe55ae111d8ded694d53f13ac1 (patch) | |
tree | c9795e10c265e815d0a32dec516548ea614c9ce0 /wiretap/ngsniffer.c | |
parent | 4535b9314784ed5142bfe92a1160dbf155abab87 (diff) |
Fix a possible NULL dereference (Coverity CID 33).
svn path=/trunk/; revision=17556
Diffstat (limited to 'wiretap/ngsniffer.c')
-rw-r--r-- | wiretap/ngsniffer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/wiretap/ngsniffer.c b/wiretap/ngsniffer.c index 236c3bd073..4ec972408c 100644 --- a/wiretap/ngsniffer.c +++ b/wiretap/ngsniffer.c @@ -2591,7 +2591,7 @@ ng_file_seek_rand(wtap *wth, long offset, int whence, int *err) the uncompressed byte stream, starting with the blob following the current blob. */ new = g_list_next(ngsniffer->current_blob); - for (;;) { + while (new) { next = g_list_next(new); if (next == NULL) { /* No more blobs; the current one is it. */ @@ -2615,7 +2615,7 @@ ng_file_seek_rand(wtap *wth, long offset, int whence, int *err) the uncompressed byte stream, starting with the blob preceding the current blob. */ new = g_list_previous(ngsniffer->current_blob); - for (;;) { + while (new) { /* Does this blob start at or before the target offset? If so, the current blob is the one we want. */ new_blob = new->data; |