(/home/sate/Testcases/c/cve/wireshark-1.2.0/print.c) |
| |
| 1433 | | | void proto_tree_write_fields(output_fields_t* fields, epan_dissect_t *edt, FILE *fh) |
| 1434 | | | { |
| 1435 | | | gsize i; |
| 1436 | | | |
| 1437 | | | write_field_data_t data; |
| 1438 | | | |
| 1439 | | | g_assert(fields);
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__)) |
| |
|
| 1440 | | | g_assert(edt);
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__)) |
| |
|
| 1441 | | | g_assert(fh);
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__)) |
| |
|
| 1442 | | | |
| 1443 | | | data.fields = fields; |
| 1444 | | | data.edt = edt; |
| 1445 | | | |
| 1446 | | | if(NULL == fields->field_indicies) { |
| 1447 | | | |
| 1448 | | | fields->field_indicies = g_hash_table_new(g_str_hash, g_str_equal); |
| 1449 | | | |
| 1450 | | | i = 0; |
| 1451 | | | while( i < fields->fields->len) { |
| 1452 | | | gchar* field = g_ptr_array_index(fields->fields, i);
x /usr/include/glib-2.0/glib/garray.h |
| |
111 | #define g_ptr_array_index(array,index_) ((array)->pdata)[index_] |
| |
|
| 1453 | | | |
| 1454 | | | |
| 1455 | | | |
| 1456 | | | ++i; |
| 1457 | | | g_hash_table_insert(fields->field_indicies, field, GUINT_TO_POINTER(i)); |
| 1458 | | | } |
| 1459 | | | } |
| 1460 | | | |
| 1461 | | | |
| 1462 | | | fields->field_values = ep_alloc_array0(const gchar*, fields->fields->len);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/emem.h |
| |
75 | #define ep_alloc_array0(type,num) (type*)ep_alloc0(sizeof(type)*(num)) |
| |
|
| 1463 | | | |
| 1464 | | | proto_tree_children_foreach(edt->tree, proto_tree_get_node_field_values, |
| 1465 | | | &data); |
| 1466 | | | |
| 1467 | | | for(i = 0; i < fields->fields->len; ++i) { |
Event 2:
Continuing from loop body. Leaving loop. i < fields->fields->len evaluates to false.
hide
|
|
| 1468 | | | if(0 != i) { |
| 1469 | | | fputc(fields->separator, fh); |
| 1470 | | | } |
| 1471 | | | if(NULL != fields->field_values[i]) { |
| 1472 | | | if(fields->quote != '\0') { |
| 1473 | | | fputc(fields->quote, fh); |
| 1474 | | | } |
| 1475 | | | fputs(fields->field_values[i], fh); |
| 1476 | | | if(fields->quote != '\0') { |
| 1477 | | | fputc(fields->quote, fh); |
Ignored Return Value
The return value of fputc() is never checked in the highlighted execution scenario. - If the return value can indicate an error, the error will be ignored if the highlighted code executes.
- CodeSonar is configured to enforce Ignored Return Value checks for fputc(). (To change the set of enforced Ignored Return Value checks, use configuration file parameters RETURN_CHECKER_CHECKED_FUNCS and RETURN_CHECKER_IGNORED_FUNCS).
Show: All events | Only primary events |
|
| 1478 | | | } |
| 1479 | | | } |
| 1480 | | | } |
| 1481 | | | } |
| |