(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-isakmp.c) |
| |
| 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 | | | |
| 3054 | | | return msg; |
| 3055 | | | } |
| 3056 | | | n += ret; |
| 3057 | | | sep = " & "; |
| 3058 | | | } |
| 3059 | | | if (type & SIT_SECRECY) { |
| 3060 | | | if (n >= SIT_MSG_NUM) { |
| 3061 | | | |
| 3062 | | | return msg; |
Unreachable Computation
The highlighted code will not execute under any circumstances. This may be because of: |
|
| 3063 | | | } |
| 3064 | | | ret = g_snprintf(msg, SIT_MSG_NUM-n, "%sSECRECY", sep); |
| 3065 | | | if (ret >= SIT_MSG_NUM-n) { |
| 3066 | | | |
| 3067 | | | return msg; |
| 3068 | | | } |
| 3069 | | | n += ret; |
| 3070 | | | sep = " & "; |
| 3071 | | | } |
| 3072 | | | if (type & SIT_INTEGRITY) { |
| 3073 | | | if (n >= SIT_MSG_NUM) { |
| 3074 | | | |
| 3075 | | | return msg; |
| 3076 | | | } |
| 3077 | | | ret = g_snprintf(msg, SIT_MSG_NUM-n, "%sINTEGRITY", sep); |
| 3078 | | | if (ret >= SIT_MSG_NUM-n) { |
| 3079 | | | |
| 3080 | | | return msg; |
| 3081 | | | } |
| 3082 | | | n += ret; |
| 3083 | | | sep = " & "; |
| 3084 | | | } |
| 3085 | | | |
| 3086 | | | return msg; |
| 3087 | | | } |
| |