Text   |  XML   |  ReML   |   Visible Warnings:

Unreachable Data Flow  at packet-memcache.c:1339

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

memcache_response_dissector

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-memcache.c)expand/collapse
Show more  
 1294  memcache_response_dissector (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,
 1295                               const guchar *line, const guchar *lineend, guint8 opcode)
 1296  {
 1297    const guchar *next_token;
 1298    int           tokenlen;
 1299   
 1300    switch (opcode) {
 1301   
 1302    case OP_GET:
 1303    case OP_GETS:
 1304      return get_response_dissector (tvb, pinfo, tree, offset);
 1305   
 1306    case OP_VERSION:
 1307      /* response code.  */
 1308      tokenlen = get_token_len (line, lineend, &next_token);
 1309      if (tokenlen == 0) {
 1310        return -1;
 1311      }    
 1312      if ((tokenlen == 7) && strncmp (line, "VERSION", tokenlen) == 0) {
 1313        offset += (int) (next_token - line);
 1314        line = next_token;
 1315      } else {
 1316        return -1;
 1317      }
 1318   
 1319      /* version string */
 1320      tokenlen = get_token_len (line, lineend, &next_token);
 1321      if (tokenlen == 0) {
 1322        /* expecting version string. */
 1323        return -1;
 1324      }
 1325   
 1326      proto_tree_add_item (tree, hf_version, tvb, offset, tokenlen, FALSE);
 1327      offset += (int) (next_token - line);
 1328      line = next_token;
 1329   
 1330      /* CRLF */
 1331      tokenlen = get_token_len (line, lineend, &next_token);
 1332      if (tokenlen == 0) {
 1333        return offset;
 1334      } else {
 1335        /* invalid token */
 1336        return -1;
 1337      }
 1338   
 1339      return offset;
 1340   
 1341    case OP_STAT:
 1342      return stat_dissector (tvb, tree, offset);
 1343   
 1344    default:
 1345      break;
 1346    }
 1347   
 1348    /* response code.  */
 1349    tokenlen = get_token_len (line, lineend, &next_token);
 1350    if (tokenlen == 0) {
 1351      return -1;
 1352    }
 1353   
 1354    /* all the following mark an end of a response.
 1355     * should take care of set, add, cas, append, replace 
 1356     * prepend, flush_all, verbosity, delete and to an extent 
 1357     * incr, decr and stat commands.
 1358     */
 1359    if ((tokenlen == 6 && strncmp (line, "STORED", tokenlen) == 0) ||
 1360        (tokenlen == 10 && strncmp (line, "NOT_STORED", tokenlen) == 0) ||
 1361        (tokenlen == 6 && strncmp (line, "EXISTS", tokenlen) == 0) ||
 1362        (tokenlen == 9 && strncmp (line, "NOT_FOUND", tokenlen) == 0) ||
 1363        (tokenlen == 7 && strncmp (line, "DELETED", tokenlen) == 0) ||
 1364        (tokenlen == 2 && strncmp (line, "OK", tokenlen) == 0) ||
 1365        (tokenlen == 3 && strncmp (line, "END", tokenlen) == 0))  
 1366    {
 1367      proto_tree_add_item (tree, hf_response, tvb, offset, tokenlen, FALSE);
 1368      offset += (int) (next_token - line);
 1369      line = next_token;
 1370      return offset;
 1371    }
 1372   
 1373    /* if we have reached this point:
 1374     * it is either an incr/decr response of the format  
 1375     *  <value>\r\n.  
 1376     *  or
 1377     *  "stats sizes" response of the format:
 1378     *  <size> <count> \r\n
 1379     */
 1380    if (opcode == OP_INCREMENT) {
 1381      return incr_dissector (tvb, tree, offset);
 1382    }
 1383   
 1384    return offset;
 1385  }
Show more  




Change Warning 2730.34612 : Unreachable Data Flow

Priority:
State:
Finding:
Owner:
Note: