Text   |  XML   |  ReML   |   Visible Warnings:

Cast Alters Value  at drag_and_drop.c:129

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

dnd_uri2filename

(/home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/drag_and_drop.c)expand/collapse
Show more  
 60  static gchar *
 61  dnd_uri2filename(gchar *cf_name)
 62  {
 63      gchar     *src, *dest;
 64      gint      ret;
 65      guint     i;
 66      gchar     esc[3];
 67   
 68   
 69      /* Remove URI header.
 70       * we have to remove the prefix to get a valid filename. */
 71  #ifdef _WIN32 
 72
82
Show [ Lines 72 to 82 omitted. ]
 83          cf_name += 8;
 84      }
 85  #else
 86      /*
 87       * On UNIX (at least KDE 3.0 Konqueror), this prefix looks like:
 88       * file:/dir1/dir2/capture-file.cap
 89       *
 90       * On UNIX (at least GNOME Nautilus 2.8.2), this prefix looks like:
 91       * file:///dir1/dir2/capture-file.cap
 92       */
 93      if (strncmp("file:", cf_name, 5) == 0) {
 94          /* now becoming: /dir1/dir2/capture-file.cap or ///dir1/dir2/capture-file.cap */
 95          cf_name += 5;
 96          /* shorten //////thing to /thing */
 97          for(; cf_name[1] == '/'; ++cf_name);
 98      }
 99  #endif
 100   
 101      /*
 102       * unescape the escaped URI characters (spaces, ...)
 103       *
 104       * we have to replace escaped chars to their equivalents,
 105       * e.g. %20 (always a two digit hexstring) -> ' '
 106       * the percent character '%' is escaped be a double one "%%"
 107       *
 108       * we do this conversation "in place" as the result is always 
 109       * equal or smaller in size.
 110       */
 111      src = cf_name;
 112      dest = cf_name;
 113      while (*src) {
 114          if (*src == '%') {
 115              src++;
 116              if (*src == '%') {
 117                  /* this is an escaped '%' char (was: "%%") */
 118                  *dest = *src;
 119                  src++;
 120                  dest++;
 121              } else {
 122                  /* convert escaped hexnumber to unscaped character */
 123                  esc[0] = src[0];
 124                  esc[1] = src[1];
 125                  esc[2] = '\0';
 126                  ret = sscanf(esc, "%x", &i);
 127                  if (ret == 1) {
 128                      src+=2;
 129                      *dest = (gchar) i;
Show more  




Change Warning 3980.29908 : Cast Alters Value

Priority:
State:
Finding:
Owner:
Note: