(/home/sate/Testcases/c/cve/wireshark-1.2.0/file.c) |
| |
| 655 | | | cf_continue_tail(capture_file *cf, volatile int to_read, int *err) |
| 656 | | | { |
| 657 | | | gint64 data_offset = 0; |
| 658 | | | gchar *err_info; |
| 659 | | | volatile int newly_displayed_packets = 0; |
| 660 | | | dfilter_t *dfcode; |
| 661 | | | |
| 662 | | | |
| 663 | | | |
| 664 | | | |
| 665 | | | |
| 666 | | | dfcode=NULL; |
| 667 | | | if(cf->dfilter){ |
| 668 | | | dfilter_compile(cf->dfilter, &dfcode); |
| 669 | | | } |
| 670 | | | |
| 671 | | | *err = 0; |
| 672 | | | |
| 673 | | | packet_list_check_end(); |
| 674 | | | packet_list_freeze(); |
| 675 | | | |
| 676 | | | |
| 677 | | | |
| 678 | | | while (to_read != 0 && (wtap_read(cf->wth, err, &err_info, &data_offset))) { |
| 679 | | | if (cf->state == FILE_READ_ABORTED) { |
| 680 | | | |
| 681 | | | |
| 682 | | | |
| 683 | | | break; |
| 684 | | | } |
| 685 | | | TRY{
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
176 | #define TRY \ |
177 | {\ |
178 | except_t *exc; \ |
179 | volatile int except_state = 0; \ |
180 | static const except_id_t catch_spec[] = { \ |
181 | { XCEPT_GROUP_WIRESHARK, XCEPT_CODE_ANY } }; \ |
182 | except_try_push(catch_spec, 1, &exc); \ |
183 | \ |
184 | if(except_state & EXCEPT_CAUGHT) \ |
185 | except_state |= EXCEPT_RETHROWN; \ |
186 | except_state &= ~EXCEPT_CAUGHT; \ |
187 | \ |
188 | if (except_state == 0 && exc == 0) \ |
189 | /* user's code goes here */ |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/except.h |
| |
143 | #define except_try_push(ID, NUM, PPE) \ |
144 | { \ |
145 | struct except_stacknode except_sn; \ |
146 | struct except_catch except_ch; \ |
147 | except_setup_try(&except_sn, &except_ch, ID, NUM); \ |
148 | if (setjmp(except_ch.except_jmp)) \ |
149 | *(PPE) = &except_ch.except_obj; \ |
150 | else \ |
151 | *(PPE) = 0 |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
165 | #define EXCEPT_CAUGHT 1 /* exception has been caught, no need to rethrow at |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
168 | #define EXCEPT_RETHROWN 2 /* the exception was rethrown from a CATCH |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
165 | #define EXCEPT_CAUGHT 1 /* exception has been caught, no need to rethrow at |
| |
|
| 686 | | | if (read_packet(cf, dfcode, data_offset) != -1) { |
| 687 | | | newly_displayed_packets++; |
| 688 | | | } |
| 689 | | | } |
| 690 | | | CATCH(OutOfMemoryError) {
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
202 | #define CATCH(x) \ |
203 | if (except_state == 0 && exc != 0 && exc->except_id.except_code == (x) && \ |
204 | (except_state |= EXCEPT_CAUGHT)) \ |
205 | /* user's code goes here */ |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
165 | #define EXCEPT_CAUGHT 1 /* exception has been caught, no need to rethrow at |
| |
|
| 691 | | | gpointer dialog; |
| 692 | | | |
| 693 | | | dialog = simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, |
| 694 | | | "%sOut Of Memory!%s\n" |
| 695 | | | "\n" |
| 696 | | | "Sorry, but Wireshark has to terminate now!\n" |
| 697 | | | "\n" |
| 698 | | | "The capture file is not lost, it can be found at:\n" |
| 699 | | | "%s\n" |
| 700 | | | "\n" |
| 701 | | | "Some infos / workarounds can be found at:\n" |
| 702 | | | "http://wiki.wireshark.org/KnownBugs/OutOfMemory", |
| 703 | | | simple_dialog_primary_start(), simple_dialog_primary_end(), cf->filename); |
| 704 | | | |
| 705 | | | simple_dialog_set_cb(dialog, outofmemory_cb, NULL); |
| 706 | | | while(1) { |
| 707 | | | main_window_update(); |
| 708 | | | |
| 709 | | | |
| 710 | | | }; |
| 711 | | | packet_list_thaw(); |
Unreachable Call
The highlighted code will not execute under any circumstances. This may be because of: |
|
| 712 | | | return CF_READ_ABORTED; |
| 713 | | | } |
| 714 | | | ENDTRY;
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
191 | #define ENDTRY \ |
192 | /* rethrow the exception if necessary */ \ |
193 | if(!(except_state&EXCEPT_CAUGHT) && exc != 0) \ |
194 | except_rethrow(exc); \ |
195 | except_try_pop();\ |
196 | } |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
165 | #define EXCEPT_CAUGHT 1 /* exception has been caught, no need to rethrow at |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/except.h |
| |
153 | #define except_try_pop() \ |
154 | except_free(except_ch.except_obj.except_dyndata); \ |
155 | except_pop(); \ |
156 | } |
| |
|
| 715 | | | to_read--; |
| 716 | | | } |
| 717 | | | |
| 718 | | | |
| 719 | | | if (dfcode != NULL){ |
| 720 | | | dfilter_free(dfcode); |
| 721 | | | } |
| 722 | | | |
| 723 | | | |
| 724 | | | |
| 725 | | | |
| 726 | | | |
| 727 | | | packet_list_thaw(); |
| 728 | | | |
| 729 | | | |
| 730 | | | |
| 731 | | | |
| 732 | | | |
| 733 | | | |
| 734 | | | |
| 735 | | | if (newly_displayed_packets && auto_scroll_live && cf->plist_end != NULL) |
| 736 | | | packet_list_moveto_end(); |
| 737 | | | |
| 738 | | | if (cf->state == FILE_READ_ABORTED) { |
| 739 | | | |
| 740 | | | |
| 741 | | | |
| 742 | | | |
| 743 | | | |
| 744 | | | return CF_READ_ABORTED; |
| 745 | | | } else if (*err != 0) { |
| 746 | | | |
| 747 | | | |
| 748 | | | g_warning("Error \"%s\" while reading: \"%s\"\n",
x /usr/include/glib-2.0/glib/gmessages.h |
| |
153 | #define g_warning(...) g_log (G_LOG_DOMAIN, \ |
154 | G_LOG_LEVEL_WARNING, \ |
155 | __VA_ARGS__) |
| |
|
| 749 | | | wtap_strerror(*err), cf->filename); |
| 750 | | | |
| 751 | | | return CF_READ_ERROR; |
| 752 | | | } else |
| 753 | | | return CF_READ_OK; |
| 754 | | | } |
| |