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

listOfString8

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-x11.c)expand/collapse
Show more  
 2016  static void listOfString8(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf,
 2017                            int hf_item, int length, gboolean little_endian)
 2018  {
 2019        char *s = NULL;
 2020        guint allocated = 0;
 2021        proto_item *ti;
 2022        proto_tree *tt;
 2023        int i;
 2024   
 2025        /* Compute total length */
 2026   
 2027        int scanning_offset = *offsetp; /* Scanning pointer */
 2028        int l;
 2029        for(i = length; i; i--) {
 2030              l = tvb_get_guint8(tvb, scanning_offset);
 2031              scanning_offset += 1 + l;
 2032        }
 2033   
 2034        ti = proto_tree_add_item(t, hf, tvb, *offsetp, scanning_offset - *offsetp, little_endian);
 2035        tt = proto_item_add_subtree(ti, ett_x11_list_of_string8);
 2036   
 2037        while(length--) {
 2038[+]             unsigned l = VALUE8(tvb, *offsetp);
 2039              if (allocated < (l + 1)) {
 2040                    s = ep_alloc(l + 1);
 2041                    allocated = l + 1;
 2042              }
 2043[+]             stringCopy(s, (gchar *)tvb_get_ptr(tvb, *offsetp + 1, l), l); /* Nothing better for now. We need a better string handling API. */
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 3059.32020 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: