Text   |  XML   |  ReML   |   Visible Warnings:

Redundant Condition  at packet-isakmp.c:3060

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

situation2str

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-isakmp.c)expand/collapse
Show more  
 3036  static const char *
 3037  situation2str(guint32 type)
 3038  {
 3039   
 3040  #define SIT_MSG_NUM     1024
 3041  #define SIT_IDENTITY    0x01 
 3042  #define SIT_SECRECY     0x02
 3043  #define SIT_INTEGRITY   0x04
 3044   
 3045    static char   msg[SIT_MSG_NUM];
 3046    int           n = 0;
 3047    const char *  sep = "";
 3048    int           ret;
 3049   
 3050    if (type & SIT_IDENTITY) {
 3051      ret = g_snprintf(msg, SIT_MSG_NUM-n, "%sIDENTITY", sep);
 3052      if (ret >= SIT_MSG_NUM-n) {
 3053        /* Truncated. */
 3054        return msg;
 3055      }
 3056      n += ret;
 3057      sep = " & ";
 3058    }
 3059    if (type & SIT_SECRECY) {
 3060      if (n >= SIT_MSG_NUM) {
 3061        /* No more room. */
 3062        return msg;
 3063      }
 3064      ret = g_snprintf(msg, SIT_MSG_NUM-n, "%sSECRECY", sep);
 3065      if (ret >= SIT_MSG_NUM-n) {
 3066        /* Truncated. */
 3067        return msg;
 3068      }
 3069      n += ret;
 3070      sep = " & ";
 3071    }
 3072    if (type & SIT_INTEGRITY) {
 3073      if (n >= SIT_MSG_NUM) {
 3074        /* No more room. */
 3075        return msg;
 3076      }
 3077      ret = g_snprintf(msg, SIT_MSG_NUM-n, "%sINTEGRITY", sep);
 3078      if (ret >= SIT_MSG_NUM-n) {
 3079        /* Truncated. */
 3080        return msg;
 3081      }
 3082      n += ret;
 3083      sep = " & ";
 3084    }
 3085   
 3086    return msg;
 3087  }
Show more  




Change Warning 1208.29486 : Redundant Condition

Priority:
State:
Finding:
Owner:
Note: