Text   |  XML   |  ReML   |   Visible Warnings:

Unreachable Control Flow  at dtd_parse.c:1114

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

Dtd_Parse_lex

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dtd_parse.c)expand/collapse
Show more  
 916  YY_DECL 
 917  {
 918          register yy_state_type yy_current_state;
 919          register char *yy_cp, *yy_bp;
 920          register int yy_act;
 921       
 922  #line 175 "dtd_parse.l"
 923   
 924   
 925  #line 926 "dtd_parse.c"
 926   
 927          if ( !(yy_init) )
 928                  {
 929                  (yy_init) = 1;
 930   
 931  #ifdef YY_USER_INIT 
 932                  YY_USER_INIT;
 933  #endif
 934   
 935                  if ( ! (yy_start) )
 936                          (yy_start) = 1; /* first start state */
 937   
 938                  if ( ! Dtd_Parse_in )
 939                          Dtd_Parse_in = stdin;
 940   
 941                  if ( ! Dtd_Parse_out )
 942                          Dtd_Parse_out = stdout;
 943   
 944                  if ( ! YY_CURRENT_BUFFER ) {
 945                          Dtd_Parse_ensure_buffer_stack ();
 946                          YY_CURRENT_BUFFER_LVALUE =
 947                                  Dtd_Parse__create_buffer(Dtd_Parse_in,YY_BUF_SIZE );
 948                  }
 949   
 950                  Dtd_Parse__load_buffer_state( );
 951                  }
 952   
 953          while ( 1 )             /* loops until end-of-file is reached */
 954                  {
 955                  yy_cp = (yy_c_buf_p);
 956   
 957                  /* Support of Dtd_Parse_text. */
 958                  *yy_cp = (yy_hold_char);
 959   
 960                  /* yy_bp points to the position in yy_ch_buf of the start of 
 961                   * the current run.
 962                   */
 963                  yy_bp = yy_cp;
 964   
 965                  yy_current_state = (yy_start);
 966  yy_match:
 967                  do 
 968                          {
 969                          register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
 970                          if ( yy_accept[yy_current_state] )
 971                                  {
 972                                  (yy_last_accepting_state) = yy_current_state;
 973                                  (yy_last_accepting_cpos) = yy_cp;
 974                                  }
 975                          while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 976                                  {
 977                                  yy_current_state = (int) yy_def[yy_current_state];
 978                                  if ( yy_current_state >= 219 )
 979                                          yy_c = yy_meta[(unsigned int) yy_c];
 980                                  }
 981                          yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
 982                          ++yy_cp;
 983                          }
 984                  while ( yy_current_state != 218 );
 985                  yy_cp = (yy_last_accepting_cpos);
 986                  yy_current_state = (yy_last_accepting_state);
 987   
 988  yy_find_action:
 989                  yy_act = yy_accept[yy_current_state];
 990   
 991                  YY_DO_BEFORE_ACTION;
 992   
 993  do_action:      /* This label is used only to access EOF actions. */
 994   
 995                  switch ( yy_act )
 996          { /* beginning of action switch */
 997                          case 0: /* must back up */
 998                          /* undo the effects of YY_DO_BEFORE_ACTION */
 999                          *yy_cp = (yy_hold_char);
 1000                          yy_cp = (yy_last_accepting_cpos);
 1001                          yy_current_state = (yy_last_accepting_state);
 1002                          goto yy_find_action;
 1003   
 1004  case 1:
 1005  /* rule 1 can match eol */
 1006  YY_RULE_SETUP 
 1007  #line 177 "dtd_parse.l"
 1008  ;
 1009          YY_BREAK 
 1010  case 2:
 1011  YY_RULE_SETUP 
 1012  #line 180 "dtd_parse.l"
 1013  { BEGIN IN_COMMENT; }
 1014          YY_BREAK 
 1015  case 3:
 1016  /* rule 3 can match eol */
 1017  #line 182 "dtd_parse.l"
 1018  case 4:
 1019  /* rule 4 can match eol */
 1020  YY_RULE_SETUP 
 1021  #line 182 "dtd_parse.l"
 1022  ;
 1023          YY_BREAK 
 1024  case 5:
 1025  YY_RULE_SETUP 
 1026  #line 183 "dtd_parse.l"
 1027  { BEGIN DTD; }
 1028          YY_BREAK 
 1029  case 6:
 1030  YY_RULE_SETUP 
 1031  #line 185 "dtd_parse.l"
 1032  { BEGIN IN_NOTATION; }
 1033          YY_BREAK 
 1034  case 7:
 1035  /* rule 7 can match eol */
 1036  YY_RULE_SETUP 
 1037  #line 186 "dtd_parse.l"
 1038  ;
 1039          YY_BREAK 
 1040  case 8:
 1041  YY_RULE_SETUP 
 1042  #line 187 "dtd_parse.l"
 1043  { BEGIN DTD; }
 1044          YY_BREAK 
 1045  case 9:
 1046  YY_RULE_SETUP 
 1047  #line 189 "dtd_parse.l"
 1048  {
 1049          BEGIN XMLPI;
 1050  }
 1051          YY_BREAK 
 1052  case 10:
 1053  YY_RULE_SETUP 
 1054  #line 193 "dtd_parse.l"
 1055  {
 1056          BEGIN LOCATION;
 1057  }
 1058          YY_BREAK 
 1059  case 11:
 1060  YY_RULE_SETUP 
 1061  #line 197 "dtd_parse.l"
 1062  {
 1063          BEGIN PROTOCOL;
 1064  }
 1065          YY_BREAK 
 1066  case 12:
 1067  YY_RULE_SETUP 
 1068  #line 201 "dtd_parse.l"
 1069  ;
 1070          YY_BREAK 
 1071  case 13:
 1072  YY_RULE_SETUP 
 1073  #line 202 "dtd_parse.l"
 1074  BEGIN DTD;
 1075          YY_BREAK 
 1076  case 14:
 1077  /* rule 14 can match eol */
 1078  YY_RULE_SETUP 
 1079  #line 204 "dtd_parse.l"
 1080  {
 1081      if(location) g_free(location);
 1082          location = g_strdup(Dtd_Parse_text);
 1083          BEGIN DONE;
 1084  }
 1085          YY_BREAK 
 1086  case 15:
 1087  YY_RULE_SETUP 
 1088  #line 210 "dtd_parse.l"
 1089  BEGIN DTD;
 1090          YY_BREAK 
 1091  case 16:
 1092  YY_RULE_SETUP 
 1093  #line 212 "dtd_parse.l"
 1094  {
 1095          attr_name = g_strdup(Dtd_Parse_text);
 1096          g_strdown(attr_name);
 1097          BEGIN GET_ATTR_QUOTE;
 1098  }
 1099          YY_BREAK 
 1100  case 17:
 1101  YY_RULE_SETUP 
 1102  #line 218 "dtd_parse.l"
 1103  { BEGIN GET_ATTR_VAL; }
 1104          YY_BREAK 
 1105  case 18:
 1106  YY_RULE_SETUP 
 1107  #line 220 "dtd_parse.l"
 1108  {
 1109          g_string_append_printf(build_data->error,
 1110                                          "error in wireshark:protocol xmpli at %s : could not find attribute value!",
 1111                                          location);
 1112          yyterminate();
 1113  }
 1114          YY_BREAK 
 1115  case 19:
 1116  /* rule 19 can match eol */
 1117  YY_RULE_SETUP 
 1118  #line 227 "dtd_parse.l"
 1119  {
 1120          /*"*/
 1121          struct _proto_xmlpi_attr* pa;
 1122          gboolean got_it = FALSE;
 1123           
 1124          for(pa = proto_attrs; pa->name; pa++) {
 1125                  if (g_ascii_strcasecmp(attr_name,pa->name) == 0) {
 1126                          pa->act(Dtd_Parse_text);
 1127                          got_it = TRUE;
 1128                          break;
 1129                  }
 1130          }
 1131           
 1132          if (! got_it) {
 1133                  g_string_append_printf(build_data->error,
 1134                                                  "error in wireshark:protocol xmpli at %s : no such parameter %s!",
 1135                                                  location, attr_name);
 1136                  g_free(attr_name);
 1137                  yyterminate();
 1138          }
 1139           
 1140          g_free(attr_name);
 1141                   
 1142          BEGIN GET_ATTR_CLOSE_QUOTE;
 1143  }
 1144          YY_BREAK 
 1145  case 20:
 1146  YY_RULE_SETUP 
 1147  #line 253 "dtd_parse.l"
 1148  { BEGIN PROTOCOL;}
 1149          YY_BREAK 
 1150  case 21:
 1151  YY_RULE_SETUP 
 1152  #line 255 "dtd_parse.l"
 1153  BEGIN DTD;
 1154          YY_BREAK 
 1155  case 22:
 1156  YY_RULE_SETUP 
 1157  #line 257 "dtd_parse.l"
 1158  { DTD_PARSE(TOKEN_TAG_START); }
 1159          YY_BREAK 
 1160  case 23:
 1161  YY_RULE_SETUP 
 1162  #line 258 "dtd_parse.l"
 1163  { DTD_PARSE(TOKEN_TAG_STOP); }
 1164          YY_BREAK 
 1165  case 24:
 1166  YY_RULE_SETUP 
 1167  #line 260 "dtd_parse.l"
 1168  { DTD_PARSE(TOKEN_ATTLIST_KW); }
 1169          YY_BREAK 
 1170  case 25:
 1171  YY_RULE_SETUP 
 1172  #line 261 "dtd_parse.l"
 1173  { DTD_PARSE(TOKEN_ELEMENT_KW); }
 1174          YY_BREAK 
 1175  case 26:
 1176  YY_RULE_SETUP 
 1177  #line 262 "dtd_parse.l"
 1178  { DTD_PARSE(TOKEN_DOCTYPE_KW); }
 1179          YY_BREAK 
 1180  case 27:
 1181  YY_RULE_SETUP 
 1182  #line 264 "dtd_parse.l"
 1183  { DTD_PARSE(TOKEN_ELEM_DATA); }  
 1184          YY_BREAK 
 1185  case 28:
 1186  YY_RULE_SETUP 
 1187  #line 265 "dtd_parse.l"
 1188  { DTD_PARSE(TOKEN_ELEM_DATA); }
 1189          YY_BREAK 
 1190  case 29:
 1191  YY_RULE_SETUP 
 1192  #line 266 "dtd_parse.l"
 1193  { DTD_PARSE(TOKEN_ELEM_DATA); }
 1194          YY_BREAK 
 1195  case 30:
 1196  YY_RULE_SETUP 
 1197  #line 267 "dtd_parse.l"
 1198  { DTD_PARSE(TOKEN_EMPTY_KW); }
 1199          YY_BREAK 
 1200  case 31:
 1201  YY_RULE_SETUP 
 1202  #line 269 "dtd_parse.l"
 1203  { DTD_PARSE(TOKEN_ATT_TYPE); }
 1204          YY_BREAK 
 1205  case 32:
 1206  YY_RULE_SETUP 
 1207  #line 270 "dtd_parse.l"
 1208  { DTD_PARSE(TOKEN_ATT_TYPE); }
 1209          YY_BREAK 
 1210  case 33:
 1211  YY_RULE_SETUP 
 1212  #line 271 "dtd_parse.l"
 1213  { DTD_PARSE(TOKEN_ATT_TYPE); }
 1214          YY_BREAK 
 1215  case 34:
 1216  YY_RULE_SETUP 
 1217  #line 272 "dtd_parse.l"
 1218  { DTD_PARSE(TOKEN_ATT_TYPE); }
 1219          YY_BREAK 
 1220  case 35:
 1221  YY_RULE_SETUP 
 1222  #line 273 "dtd_parse.l"
 1223  { DTD_PARSE(TOKEN_ATT_TYPE); }
 1224          YY_BREAK 
 1225  case 36:
 1226  YY_RULE_SETUP 
 1227  #line 274 "dtd_parse.l"
 1228  { DTD_PARSE(TOKEN_ATT_TYPE); }
 1229          YY_BREAK 
 1230  case 37:
 1231  YY_RULE_SETUP 
 1232  #line 275 "dtd_parse.l"
 1233  { DTD_PARSE(TOKEN_ATT_TYPE); }
 1234          YY_BREAK 
 1235  case 38:
 1236  YY_RULE_SETUP 
 1237  #line 276 "dtd_parse.l"
 1238  { DTD_PARSE(TOKEN_ATT_TYPE); }
 1239          YY_BREAK 
 1240  case 39:
 1241  YY_RULE_SETUP 
 1242  #line 277 "dtd_parse.l"
 1243  { DTD_PARSE(TOKEN_ATT_TYPE); }
 1244          YY_BREAK 
 1245  case 40:
 1246  YY_RULE_SETUP 
 1247  #line 278 "dtd_parse.l"
 1248  { DTD_PARSE(TOKEN_ATT_DEF_WITH_VALUE); }
 1249          YY_BREAK 
 1250  case 41:
 1251  YY_RULE_SETUP 
 1252  #line 279 "dtd_parse.l"
 1253  { DTD_PARSE(TOKEN_ATT_DEF_WITH_VALUE); }
 1254          YY_BREAK 
 1255  case 42:
 1256  YY_RULE_SETUP 
 1257  #line 280 "dtd_parse.l"
 1258  { DTD_PARSE(TOKEN_ATT_DEF); }
 1259          YY_BREAK 
 1260  case 43:
 1261  YY_RULE_SETUP 
 1262  #line 281 "dtd_parse.l"
 1263  { DTD_PARSE(TOKEN_ATT_DEF); }
 1264          YY_BREAK 
 1265  case 44:
 1266  YY_RULE_SETUP 
 1267  #line 283 "dtd_parse.l"
 1268  { DTD_PARSE(TOKEN_STAR); }
 1269          YY_BREAK 
 1270  case 45:
 1271  YY_RULE_SETUP 
 1272  #line 284 "dtd_parse.l"
 1273  { DTD_PARSE(TOKEN_QUESTION); }
 1274          YY_BREAK 
 1275  case 46:
 1276  YY_RULE_SETUP 
 1277  #line 285 "dtd_parse.l"
 1278  { DTD_PARSE(TOKEN_PLUS); }
 1279          YY_BREAK 
 1280  case 47:
 1281  YY_RULE_SETUP 
 1282  #line 286 "dtd_parse.l"
 1283  { DTD_PARSE(TOKEN_COMMA); }
 1284          YY_BREAK 
 1285  case 48:
 1286  YY_RULE_SETUP 
 1287  #line 287 "dtd_parse.l"
 1288  { DTD_PARSE(TOKEN_OPEN_PARENS); }
 1289          YY_BREAK 
 1290  case 49:
 1291  YY_RULE_SETUP 
 1292  #line 288 "dtd_parse.l"
 1293  { DTD_PARSE(TOKEN_CLOSE_PARENS); }
 1294          YY_BREAK 
 1295  case 50:
 1296  YY_RULE_SETUP 
 1297  #line 289 "dtd_parse.l"
 1298  { DTD_PARSE(TOKEN_OPEN_BRACKET); }
 1299          YY_BREAK 
 1300  case 51:
 1301  YY_RULE_SETUP 
 1302  #line 290 "dtd_parse.l"
 1303  { DTD_PARSE(TOKEN_CLOSE_BRACKET); }
 1304          YY_BREAK 
 1305  case 52:
 1306  YY_RULE_SETUP 
 1307  #line 291 "dtd_parse.l"
 1308  { DTD_PARSE(TOKEN_PIPE); }
 1309          YY_BREAK 
 1310  case 53:
 1311  /* rule 53 can match eol */
 1312  #line 294 "dtd_parse.l"
 1313  case 54:
 1314  /* rule 54 can match eol */
 1315  YY_RULE_SETUP 
 1316  #line 294 "dtd_parse.l"
 1317  { DTD_PARSE(TOKEN_QUOTED); }
 1318          YY_BREAK 
 1319  case 55:
 1320  YY_RULE_SETUP 
 1321  #line 295 "dtd_parse.l"
 1322  { DTD_PARSE(TOKEN_NAME); }
 1323          YY_BREAK 
 1324  case 56:
 1325  YY_RULE_SETUP 
 1326  #line 297 "dtd_parse.l"
 1327  ECHO;
 1328          YY_BREAK 
 1329  #line 1330 "dtd_parse.c"
 1330  case YY_STATE_EOF(INITIAL):
 1331  case YY_STATE_EOF(DTD):
 1332  case YY_STATE_EOF(XMLPI):
 1333  case YY_STATE_EOF(LOCATION):
 1334  case YY_STATE_EOF(DONE):
 1335  case YY_STATE_EOF(PROTOCOL):
 1336  case YY_STATE_EOF(GET_ATTR_QUOTE):
 1337  case YY_STATE_EOF(GET_ATTR_VAL):
 1338  case YY_STATE_EOF(GET_ATTR_CLOSE_QUOTE):
 1339  case YY_STATE_EOF(IN_COMMENT):
 1340  case YY_STATE_EOF(IN_NOTATION):
 1341          yyterminate();
 1342   
 1343          case YY_END_OF_BUFFER:
 1344                  {
 1345                  /* Amount of text matched not including the EOB char. */
 1346                  int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
 1347   
 1348                  /* Undo the effects of YY_DO_BEFORE_ACTION. */
 1349                  *yy_cp = (yy_hold_char);
 1350                  YY_RESTORE_YY_MORE_OFFSET 
 1351   
 1352                  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
 1353                          {
 1354                          /* We're scanning a new file or input source.  It's
 1355                           * possible that this happened because the user 
 1356                           * just pointed Dtd_Parse_in at a new source and called 
 1357                           * Dtd_Parse_lex().  If so, then we have to assure 
 1358                           * consistency between YY_CURRENT_BUFFER and our 
 1359                           * globals.  Here is the right place to do so, because 
 1360                           * this is the first action (other than possibly a 
 1361                           * back-up) that will match for the new input source.
 1362                           */
 1363                          (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
 1364                          YY_CURRENT_BUFFER_LVALUE->yy_input_file = Dtd_Parse_in;
 1365                          YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
 1366                          }
 1367   
 1368                  /* Note that here we test for yy_c_buf_p "<=" to the position 
 1369                   * of the first EOB in the buffer, since yy_c_buf_p will 
 1370                   * already have been incremented past the NUL character
 1371                   * (since all states make transitions on EOB to the
 1372                   * end-of-buffer state).  Contrast this with the test
 1373                   * in input().
 1374                   */
 1375                  if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
 1376                          { /* This was really a NUL. */
 1377                          yy_state_type yy_next_state;
 1378   
 1379                          (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
 1380   
 1381                          yy_current_state = yy_get_previous_state(  );
 1382   
 1383                          /* Okay, we're now positioned to make the NUL
 1384                           * transition.  We couldn't have 
 1385                           * yy_get_previous_state() go ahead and do it 
 1386                           * for us because it doesn't know how to deal
 1387                           * with the possibility of jamming (and we don't
 1388                           * want to build jamming into it because then it 
 1389                           * will run more slowly).
 1390                           */
 1391   
 1392                          yy_next_state = yy_try_NUL_trans( yy_current_state );
 1393   
 1394                          yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 1395   
 1396                          if ( yy_next_state )
 1397                                  {
 1398                                  /* Consume the NUL. */
 1399                                  yy_cp = ++(yy_c_buf_p);
 1400                                  yy_current_state = yy_next_state;
 1401                                  goto yy_match;
 1402                                  }
 1403   
 1404                          else 
 1405                                  {
 1406                                  yy_cp = (yy_last_accepting_cpos);
 1407                                  yy_current_state = (yy_last_accepting_state);
 1408                                  goto yy_find_action;
 1409                                  }
 1410                          }
 1411   
 1412                  else switch ( yy_get_next_buffer(  ) )
 1413                          {
 1414                          case EOB_ACT_END_OF_FILE:
 1415                                  {
 1416                                  (yy_did_buffer_switch_on_eof) = 0;
 1417   
 1418                                  if ( Dtd_Parse_wrap( ) )
 1419                                          {
 1420                                          /* Note: because we've taken care in 
 1421                                           * yy_get_next_buffer() to have set up
 1422                                           * Dtd_Parse_text, we can now set up 
 1423                                           * yy_c_buf_p so that if some total
 1424                                           * hoser (like flex itself) wants to
 1425                                           * call the scanner after we return the 
 1426                                           * YY_NULL, it'll still work - another 
 1427                                           * YY_NULL will get returned.
 1428                                           */
 1429                                          (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
 1430   
 1431                                          yy_act = YY_STATE_EOF(YY_START);
 1432                                          goto do_action;
 1433                                          }
 1434   
 1435                                  else 
 1436                                          {
 1437                                          if ( ! (yy_did_buffer_switch_on_eof) )
 1438                                                  YY_NEW_FILE;
 1439                                          }
 1440                                  break;
 1441                                  }
 1442   
 1443                          case EOB_ACT_CONTINUE_SCAN:
 1444                                  (yy_c_buf_p) =
 1445                                          (yytext_ptr) + yy_amount_of_matched_text;
 1446   
 1447                                  yy_current_state = yy_get_previous_state(  );
 1448   
 1449                                  yy_cp = (yy_c_buf_p);
 1450                                  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 1451                                  goto yy_match;
 1452   
 1453                          case EOB_ACT_LAST_MATCH:
 1454                                  (yy_c_buf_p) =
 1455                                  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
 1456   
 1457                                  yy_current_state = yy_get_previous_state(  );
 1458   
 1459                                  yy_cp = (yy_c_buf_p);
 1460                                  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 1461                                  goto yy_find_action;
 1462                          }
 1463                  break;
 1464                  }
 1465   
 1466          default:
 1467                  YY_FATAL_ERROR(
 1468                          "fatal flex scanner internal error--no action found" );
 1469          } /* end of action switch */
 1470                  } /* end of scanning one token */
 1471  } /* end of Dtd_Parse_lex */
Show more  




Change Warning 3083.30501 : Unreachable Control Flow

Priority:
State:
Finding:
Owner:
Note: