Text   |  XML   |  ReML   |   Visible Warnings:

Null Pointer Dereference  at packet-x11.c:2011

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

listOfTextItem

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-x11.c)expand/collapse
Show more  
 2106  static void listOfTextItem(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf,
 2107      int sizeIs16, int next_offset, gboolean little_endian)
 2108  {
 2109        int allocated = 0;
 2110        char *s = NULL;
 2111        proto_item *ti;
 2112        proto_tree *tt;
 2113        guint32 fid;
 2114   
 2115        /* Compute total length */
 2116   
 2117        int scanning_offset = *offsetp; /* Scanning pointer */
 2118        int l;                            /* Length of an individual item */
 2119        int n = 0;                        /* Number of items */
 2120   
 2121        while(scanning_offset < next_offset) {
 2122              l = tvb_get_guint8(tvb, scanning_offset);
 2123              scanning_offset++;
 2124              if (!l) break;
 2125              n++;
 2126              scanning_offset += l == 255 ? 4 : l + (sizeIs16 ? l : 0) + 1;
 2127        }
 2128   
 2129        ti = proto_tree_add_item(t, hf, tvb, *offsetp, scanning_offset - *offsetp, little_endian);
 2130        tt = proto_item_add_subtree(ti, ett_x11_list_of_text_item);
 2131   
 2132        while(n--) {
 2133[+]             unsigned l = VALUE8(tvb, *offsetp);
 2134              if (l == 255) { /* Item is a font */
 2135                    fid = tvb_get_ntohl(tvb, *offsetp + 1);
 2136                    proto_tree_add_uint(tt, hf_x11_textitem_font, tvb, *offsetp, 5, fid);
 2137                    *offsetp += 5;
 2138              } else { /* Item is a string */
 2139                    proto_item *tti;
 2140                    proto_tree *ttt;
 2141                    gint8 delta = VALUE8(tvb, *offsetp + 1);
 2142                    if (sizeIs16) l += l;
 2143                    if ((unsigned) allocated < l + 1) {
 2144                          s = ep_alloc(l + 1);
 2145                          allocated = l + 1;
 2146                    }
 2147[+]                   stringCopy(s, (gchar *)tvb_get_ptr(tvb, *offsetp + 2, l), l);
expand/collapse

stringCopy

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-x11.c)expand/collapse
Show more  
 2005  static void stringCopy(char *dest, const char *source, int length)
 2006  {
 2007        guchar c;
 2008        while(length--) {
 2009              c = *source++;
 2010              if (!isgraph(c) && c != ' ') c = '.';
 2011              *dest++ = c;
Show more  
Show more  




Change Warning 3061.32802 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: