(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-per.c) |
| |
| 1956 | | | dissect_per_bit_string(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len, gboolean has_extension, tvbuff_t **value_tvb) |
| 1957 | | | { |
| 1958 | | | gint val_start, val_length; |
| 1959 | | | guint32 length; |
| 1960 | | | *hfi; |
| 1961 | | | tvbuff_t *out_tvb = NULL; |
| 1962 | | | |
| 1963 | | | hfi = (hf_index==-1) ? NULL : proto_registrar_get_nth(hf_index); |
Event 1:
hf_index == -1 evaluates to true.
hide
|
|
| 1964 | | | |
| 1965 | | | DEBUG_ENTRY("dissect_per_bit_string"); |
| 1966 | | | |
| 1967 | | | if(max_len==0) { |
Event 2:
Skipping " if". max_len == 0 evaluates to false.
hide
|
|
| 1968 | | | return offset; |
| 1969 | | | } |
| 1970 | | | |
| 1971 | | | if (min_len == NO_BOUND) { |
Event 3:
Skipping " if". min_len == -1 evaluates to false.
hide
|
|
| 1972 | | | min_len = 0; |
| 1973 | | | } |
| 1974 | | | |
| 1975 | | | |
| 1976 | | | if ((min_len==max_len) && (max_len<=16)) { |
Event 4:
Skipping " if". min_len == max_len evaluates to false.
hide
|
|
| 1977 | | | out_tvb = new_octet_aligned_subset_bits(tvb, offset, actx, min_len); |
| 1978 | | | if (hfi) { |
| 1979 | | | actx->created_item = proto_tree_add_item(tree, hf_index, out_tvb, 0, -1, FALSE); |
| 1980 | | | proto_item_append_text(actx->created_item, " [bit length %u]", max_len); |
| 1981 | | | } |
| 1982 | | | offset+=min_len; |
| 1983 | | | if (value_tvb) |
| 1984 | | | *value_tvb = out_tvb; |
| 1985 | | | return offset; |
| 1986 | | | } |
| 1987 | | | |
| 1988 | | | |
| 1989 | | | |
| 1990 | | | if((min_len==max_len)&&(min_len<65536)){ |
Event 5:
Skipping " if". min_len == max_len evaluates to false.
hide
|
|
| 1991 | | | |
| 1992 | | | |
| 1993 | | | |
| 1994 | | | if (actx->aligned){ |
| 1995 | | | |
| 1996 | | | BYTE_ALIGN_OFFSET(offset);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-per.c |
| |
120 | #define BYTE_ALIGN_OFFSET(offset) if(offset&0x07){offset=(offset&0xfffffff8)+8;} |
| |
|
| 1997 | | | } |
| 1998 | | | out_tvb = new_octet_aligned_subset_bits(tvb, offset, actx, min_len); |
| 1999 | | | if (hfi) { |
| 2000 | | | actx->created_item = proto_tree_add_item(tree, hf_index, out_tvb, 0, -1, FALSE); |
| 2001 | | | proto_item_append_text(actx->created_item, " [bit length %u]", max_len); |
| 2002 | | | } |
| 2003 | | | offset+=min_len; |
| 2004 | | | if (value_tvb) |
| 2005 | | | *value_tvb = out_tvb; |
| 2006 | | | return offset; |
| 2007 | | | } |
| 2008 | | | |
| 2009 | | | |
| 2010 | | | if (max_len != NO_BOUND) { |
Event 6:
Taking false branch. max_len != -1 evaluates to false.
hide
|
|
| 2011 | | | offset=dissect_per_constrained_integer(tvb, offset, actx, |
| 2012 | | | tree, hf_per_bit_string_length, min_len, max_len, |
| 2013 | | | &length, has_extension); |
| 2014 | | | if (!display_internal_per_fields) PROTO_ITEM_SET_HIDDEN(actx->created_item);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
319 | #define PROTO_ITEM_SET_HIDDEN(proto_item) \ |
320 | ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_HIDDEN) : 0) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
246 | #define FI_SET_FLAG(fi, flag) (fi->flags = fi->flags | flag) |
| |
|
| 2015 | | | } else { |
| 2016 | [+] | | offset=dissect_per_length_determinant(tvb, offset, actx, tree, hf_per_bit_string_length, &length); |
Event 7:
dissect_per_length_determinant() does not initialize length. - This may be because of a failure case or other special case for dissect_per_length_determinant().
hide
|
|
 |
| 2017 | | | } |
| 2018 | | | if(length){ |
Uninitialized Variable
length was not initialized. The issue can occur if the highlighted code executes. See related event 7. Show: All events | Only primary events |
|
| |