(/home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/main_menu.c) |
| |
| 1271 | | | ( |
| 1272 | | | const char *name, |
| 1273 | | | register_stat_group_t group, |
| 1274 | | | const char *stock_id, |
| 1275 | | | GtkItemFactoryCallback callback, |
| 1276 | | | gboolean (*selected_packet_enabled)(frame_data *, epan_dissect_t *, gpointer callback_data), |
| 1277 | | | gboolean (*selected_tree_row_enabled)(field_info *, gpointer callback_data), |
| 1278 | | | gpointer callback_data) |
| 1279 | | | { |
| 1280 | | | |
| 1281 | | | const char *toolspath; |
| 1282 | | | const char *p; |
| 1283 | | | char *; |
| 1284 | | | size_t ; |
| 1285 | | | *child; |
| 1286 | | | GList *curnode; |
| 1287 | | | GList *childnode; |
| 1288 | | | |
| 1289 | | | |
| 1290 | | | |
| 1291 | | | |
| 1292 | | | g_assert(*name != '/');
x /usr/include/glib-2.0/glib/gtestutils.h |
| |
74 | #define g_assert(expr) do { if G_LIKELY (expr) ; else \ |
75 | g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \ |
76 | #expr); } while (0) |
| |
x /usr/include/glib-2.0/glib/gmacros.h |
| |
277 | #define G_LIKELY(expr) (__builtin_expect (_G_BOOLEAN_EXPR(expr), 1)) |
| |
x /usr/include/glib-2.0/glib/gmacros.h |
| |
268 | #define _G_BOOLEAN_EXPR(expr) \ |
269 | __extension__ ({ \ |
270 | int _g_boolean_var_; \ |
271 | if (expr) \ |
272 | _g_boolean_var_ = 1; \ |
273 | else \ |
274 | _g_boolean_var_ = 0; \ |
275 | _g_boolean_var_; \ |
276 | }) |
| |
x /usr/include/glib-2.0/glib/gmacros.h |
| |
160 | # define G_STRFUNC ((const char*) (__PRETTY_FUNCTION__)) |
| |
|
| 1293 | | | |
| 1294 | | | switch(group) { |
| 1295 | | | case(REGISTER_STAT_GROUP_GENERIC): toolspath = "/Statistics/"; break; |
| 1296 | | | case(REGISTER_STAT_GROUP_CONVERSATION_LIST): toolspath = "/Statistics/_Conversation List/"; break; |
| 1297 | | | case(REGISTER_STAT_GROUP_ENDPOINT_LIST): toolspath = "/Statistics/_Endpoint List/"; break; |
| 1298 | | | case(REGISTER_STAT_GROUP_RESPONSE_TIME): toolspath = "/Statistics/Service _Response Time/"; break; |
| 1299 | | | case(REGISTER_STAT_GROUP_UNSORTED): toolspath = "/Statistics/"; break; |
| 1300 | | | case(REGISTER_ANALYZE_GROUP_UNSORTED): toolspath = "/Analyze/"; break; |
| 1301 | | | case(REGISTER_ANALYZE_GROUP_CONVERSATION_FILTER): toolspath = "/Analyze/Conversation Filter/"; break; |
| 1302 | | | case(REGISTER_STAT_GROUP_TELEPHONY): toolspath = "/Telephony/"; break; |
| 1303 | | | case(REGISTER_TOOLS_GROUP_UNSORTED): toolspath = "/Tools/"; break; |
| 1304 | | | default: |
| 1305 | | | g_assert(!"no such group");
x /usr/include/glib-2.0/glib/gtestutils.h |
| |
74 | #define g_assert(expr) do { if G_LIKELY (expr) ; else \ |
75 | g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \ |
76 | #expr); } while (0) |
| |
x /usr/include/glib-2.0/glib/gmacros.h |
| |
277 | #define G_LIKELY(expr) (__builtin_expect (_G_BOOLEAN_EXPR(expr), 1)) |
| |
x /usr/include/glib-2.0/glib/gmacros.h |
| |
268 | #define _G_BOOLEAN_EXPR(expr) \ |
269 | __extension__ ({ \ |
270 | int _g_boolean_var_; \ |
271 | if (expr) \ |
272 | _g_boolean_var_ = 1; \ |
273 | else \ |
274 | _g_boolean_var_ = 0; \ |
275 | _g_boolean_var_; \ |
276 | }) |
| |
x /usr/include/glib-2.0/glib/gmacros.h |
| |
160 | # define G_STRFUNC ((const char*) (__PRETTY_FUNCTION__)) |
| |
|
| 1306 | | | toolspath = NULL; |
Unreachable Computation
The highlighted code will not execute under any circumstances. This may be because of: |
|
| 1307 | | | } |
| 1308 | | | |
| 1309 | | | |
| 1310 | | | if( == NULL) { |
| 1311 | | | child = g_malloc0(sizeof ()); |
| 1312 | | | = g_list_append(NULL, child); |
| 1313 | | | } |
| 1314 | | | |
| 1315 | | | |
| 1316 | | | |
| 1317 | | | |
| 1318 | | | curnode = ; |
| 1319 | | | p = name; |
| 1320 | | | while ((p = strchr(p, '/')) != NULL) { |
| 1321 | | | |
| 1322 | | | |
| 1323 | | | |
| 1324 | | | |
| 1325 | | | |
| 1326 | | | |
| 1327 | | | |
| 1328 | | | = strlen(toolspath) + 1 + (p - name); |
| 1329 | | | = g_malloc(); |
| 1330 | | | g_strlcpy(, toolspath, ); |
| 1331 | | | g_strlcat(, name, ); |
| 1332 | | | |
| 1333 | | | |
| 1334 | | | |
| 1335 | | | |
| 1336 | | | |
| 1337 | | | child = curnode->data; |
| 1338 | | | for (childnode = child->children; childnode != NULL; childnode = childnode->next) { |
| 1339 | | | child = childnode->data; |
| 1340 | | | if (strcmp(child->name, ) == 0) |
| 1341 | | | break; |
| 1342 | | | } |
| 1343 | | | if (childnode == NULL) { |
| 1344 | | | |
| 1345 | | | |
| 1346 | | | |
| 1347 | | | |
| 1348 | | | childnode = ( |
| 1349 | | | , group, "", NULL, NULL ,NULL, NULL, curnode); |
| 1350 | | | } else { |
| 1351 | | | |
| 1352 | | | |
| 1353 | | | |
| 1354 | | | g_free(); |
| 1355 | | | } |
| 1356 | | | curnode = childnode; |
| 1357 | | | |
| 1358 | | | |
| 1359 | | | |
| 1360 | | | |
| 1361 | | | p++; |
| 1362 | | | } |
| 1363 | | | |
| 1364 | | | |
| 1365 | | | |
| 1366 | | | |
| 1367 | | | = strlen(toolspath) + 1 + strlen(name); |
| 1368 | | | = g_malloc(); |
| 1369 | | | g_strlcpy(, toolspath, ); |
| 1370 | | | g_strlcat(, name, ); |
| 1371 | | | |
| 1372 | | | |
| 1373 | | | |
| 1374 | | | |
| 1375 | | | |
| 1376 | | | ( |
| 1377 | | | , group, stock_id, callback, |
| 1378 | | | selected_packet_enabled, selected_tree_row_enabled, |
| 1379 | | | callback_data, curnode); |
| 1380 | | | } |
| |