-----Ursprüngliche Nachricht----- From: [email protected] Sent: Monday, September 1, 2014 10:43 PM Subject: New Defects reported by Coverity Scan for thrift


Hi,


Please find the latest report on new defect(s) introduced to thrift found with Coverity Scan.

Defect(s) Reported-by: Coverity Scan
Showing 20 of 62 defect(s)


** CID 1174554:  Logically dead code  (DEADCODE)
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 8063 in t_test_list_bonks_read()

** CID 1174551:  Logically dead code  (DEADCODE)
/test/c_glib/gen-c_glib/t_test_thrift_test.c: 3261 in t_test_thrift_test_client_recv_test_insanity()

** CID 1174545:  Logically dead code  (DEADCODE)
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 5391 in t_test_list_type_versioning_v2_read()

** CID 1174544:  Logically dead code  (DEADCODE)
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 8361 in t_test_nested_lists_bonk_read()

** CID 1174543:  Logically dead code  (DEADCODE)
/test/c_glib/gen-c_glib/t_test_thrift_test.c: 2012 in t_test_thrift_test_client_recv_test_string_map()

** CID 1174542:  Logically dead code  (DEADCODE)
/test/c_glib/gen-c_glib/t_test_thrift_test.c: 2021 in t_test_thrift_test_client_recv_test_string_map()

** CID 1174541:  Logically dead code  (DEADCODE)
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 2123 in t_test_crazy_nesting_read()

** CID 1174540:  Logically dead code  (DEADCODE)
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 2260 in t_test_crazy_nesting_read()

** CID 1174589:  Logically dead code  (DEADCODE)
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 2271 in t_test_crazy_nesting_read()

** CID 1174588:  Logically dead code  (DEADCODE)
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 5719 in t_test_guess_protocol_struct_read()

** CID 1174587:  Logically dead code  (DEADCODE)
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 5728 in t_test_guess_protocol_struct_read()

** CID 1174576:  Logically dead code  (DEADCODE)
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 7477 in t_test_nested_mixedx2_read()

** CID 1174575:  Logically dead code  (DEADCODE)
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 7554 in t_test_nested_mixedx2_read()

** CID 1174553:  Logically dead code  (DEADCODE)
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 1762 in t_test_insanity_read()

** CID 1174552:  Logically dead code  (DEADCODE)
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 6126 in t_test_large_deltas_read()

** CID 1174622:  Dereference before null check  (REVERSE_INULL)
/test/c_glib/gen-c_glib/t_test_second_service.c: 334 in t_test_second_service_client_recv_secondtest_string() /test/c_glib/gen-c_glib/t_test_second_service.c: 337 in t_test_second_service_client_recv_secondtest_string()

** CID 1174598:  Uninitialized pointer read  (UNINIT)
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 2466 in t_test_crazy_nesting_write() /test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 2489 in t_test_crazy_nesting_write() /test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 2518 in t_test_crazy_nesting_write() /test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 2543 in t_test_crazy_nesting_write() /test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 2572 in t_test_crazy_nesting_write()

** CID 1174597:  Uninitialized pointer read  (UNINIT)
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 2507 in t_test_crazy_nesting_write() /test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 2532 in t_test_crazy_nesting_write()

** CID 1174593:  Uninitialized pointer read  (UNINIT)
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 7649 in t_test_nested_mixedx2_write() /test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 7714 in t_test_nested_mixedx2_write() /test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 7761 in t_test_nested_mixedx2_write() /test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 7786 in t_test_nested_mixedx2_write()

** CID 1174592:  Uninitialized pointer read  (UNINIT)
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 7703 in t_test_nested_mixedx2_write() /test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 7775 in t_test_nested_mixedx2_write()


________________________________________________________________________________________________________
*** CID 1174554:  Logically dead code  (DEADCODE)
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 8063 in t_test_list_bonks_read()
8057                 guint32 i;
8058                 for (i = 0; i < size; i++)
8059                 {
8060                   TTestBonk * _elem53 = NULL;
8061                   if ( _elem53 != NULL)
8062                   {
    CID 1174554:  Logically dead code  (DEADCODE)
    Execution cannot reach this statement "g_object_unref(_elem53);".
8063                     g_object_unref (_elem53);
8064                   }
8065                   _elem53 = g_object_new (T_TEST_TYPE_BONK, NULL);
8066 if ((ret = thrift_struct_read (THRIFT_STRUCT (_elem53), protocol, error)) < 0)
8067                   {
8068                     g_object_unref (_elem53);

________________________________________________________________________________________________________
*** CID 1174551:  Logically dead code  (DEADCODE)
/test/c_glib/gen-c_glib/t_test_thrift_test.c: 3261 in t_test_thrift_test_client_recv_test_insanity() 3255 if ((ret = thrift_protocol_read_i32 (protocol, &ecast77, error)) < 0)
3256                           return 0;
3257                         xfer += ret;
3258                         key75 = (TTestNumberz)ecast77;
3259                         if ( val76 != NULL)
3260                         {
    CID 1174551:  Logically dead code  (DEADCODE)
    Execution cannot reach this statement "g_object_unref(val76);".
3261                           g_object_unref (val76);
3262                         }
3263 val76 = g_object_new (T_TEST_TYPE_INSANITY, NULL); 3264 if ((ret = thrift_struct_read (THRIFT_STRUCT (val76), protocol, error)) < 0)
3265                         {
3266                           g_object_unref (val76);

________________________________________________________________________________________________________
*** CID 1174545:  Logically dead code  (DEADCODE)
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 5391 in t_test_list_type_versioning_v2_read()
5385                 guint32 i;
5386                 for (i = 0; i < size; i++)
5387                 {
5388                   gchar * _elem25 = NULL;
5389                   if (_elem25 != NULL)
5390                   {
    CID 1174545:  Logically dead code  (DEADCODE)
    Execution cannot reach this statement "g_free(_elem25);".
5391                     g_free(_elem25);
5392                     _elem25 = NULL;
5393                   }
5394
5395 if ((ret = thrift_protocol_read_string (protocol, &_elem25, error)) < 0)
5396                     return -1;

________________________________________________________________________________________________________
*** CID 1174544:  Logically dead code  (DEADCODE)
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 8361 in t_test_nested_lists_bonk_read()
8355                         guint32 i;
8356                         for (i = 0; i < size; i++)
8357                         {
8358                           TTestBonk * _elem57 = NULL;
8359                           if ( _elem57 != NULL)
8360                           {
    CID 1174544:  Logically dead code  (DEADCODE)
    Execution cannot reach this statement "g_object_unref(_elem57);".
8361                             g_object_unref (_elem57);
8362                           }
8363 _elem57 = g_object_new (T_TEST_TYPE_BONK, NULL); 8364 if ((ret = thrift_struct_read (THRIFT_STRUCT (_elem57), protocol, error)) < 0)
8365                           {
8366                             g_object_unref (_elem57);

________________________________________________________________________________________________________
*** CID 1174543:  Logically dead code  (DEADCODE)
/test/c_glib/gen-c_glib/t_test_thrift_test.c: 2012 in t_test_thrift_test_client_recv_test_string_map()
2006                   for (i = 0; i < size; i++)
2007                   {
2008                     gchar * key63 = NULL;
2009                     gchar * val64 = NULL;
2010                     if (key63 != NULL)
2011                     {
    CID 1174543:  Logically dead code  (DEADCODE)
    Execution cannot reach this statement "g_free(key63);".
2012                       g_free(key63);
2013                       key63 = NULL;
2014                     }
2015
2016 if ((ret = thrift_protocol_read_string (protocol, &key63, error)) < 0)
2017                       return 0;

________________________________________________________________________________________________________
*** CID 1174542:  Logically dead code  (DEADCODE)
/test/c_glib/gen-c_glib/t_test_thrift_test.c: 2021 in t_test_thrift_test_client_recv_test_string_map()
2015
2016 if ((ret = thrift_protocol_read_string (protocol, &key63, error)) < 0)
2017                       return 0;
2018                     xfer += ret;
2019                     if (val64 != NULL)
2020                     {
    CID 1174542:  Logically dead code  (DEADCODE)
    Execution cannot reach this statement "g_free(val64);".
2021                       g_free(val64);
2022                       val64 = NULL;
2023                     }
2024
2025 if ((ret = thrift_protocol_read_string (protocol, &val64, error)) < 0)
2026                       return 0;

________________________________________________________________________________________________________
*** CID 1174541:  Logically dead code  (DEADCODE)
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 2123 in t_test_crazy_nesting_read()
2117                 guint32 i;
2118                 for (i = 0; i < size; ++i)
2119                 {
2120                   TTestInsanity * _elem5 = NULL;
2121                   if ( _elem5 != NULL)
2122                   {
    CID 1174541:  Logically dead code  (DEADCODE)
    Execution cannot reach this statement "g_object_unref(_elem5);".
2123                     g_object_unref (_elem5);
2124                   }
2125                   _elem5 = g_object_new (T_TEST_TYPE_INSANITY, NULL);
2126 if ((ret = thrift_struct_read (THRIFT_STRUCT (_elem5), protocol, error)) < 0)
2127                   {
2128                     g_object_unref (_elem5);

________________________________________________________________________________________________________
*** CID 1174540:  Logically dead code  (DEADCODE)
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 2260 in t_test_crazy_nesting_read()
2254                                     for (i = 0; i < size; i++)
2255                                     {
2256                                       TTestInsanity * key14 = NULL;
2257                                       gchar * val15 = NULL;
2258                                       if ( key14 != NULL)
2259                                       {
    CID 1174540:  Logically dead code  (DEADCODE)
    Execution cannot reach this statement "g_object_unref(key14);".
2260                                         g_object_unref (key14);
2261                                       }
2262 key14 = g_object_new (T_TEST_TYPE_INSANITY, NULL); 2263 if ((ret = thrift_struct_read (THRIFT_STRUCT (key14), protocol, error)) < 0)
2264                                       {
2265                                         g_object_unref (key14);

________________________________________________________________________________________________________
*** CID 1174589:  Logically dead code  (DEADCODE)
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 2271 in t_test_crazy_nesting_read()
2265                                         g_object_unref (key14);
2266                                         return -1;
2267                                       }
2268                                       xfer += ret;
2269                                       if (val15 != NULL)
2270                                       {
    CID 1174589:  Logically dead code  (DEADCODE)
    Execution cannot reach this statement "g_free(val15);".
2271                                         g_free(val15);
2272                                         val15 = NULL;
2273                                       }
2274
2275 if ((ret = thrift_protocol_read_string (protocol, &val15, error)) < 0)
2276                                         return -1;

________________________________________________________________________________________________________
*** CID 1174588:  Logically dead code  (DEADCODE)
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 5719 in t_test_guess_protocol_struct_read()
5713                 for (i = 0; i < size; i++)
5714                 {
5715                   gchar * key27 = NULL;
5716                   gchar * val28 = NULL;
5717                   if (key27 != NULL)
5718                   {
    CID 1174588:  Logically dead code  (DEADCODE)
    Execution cannot reach this statement "g_free(key27);".
5719                     g_free(key27);
5720                     key27 = NULL;
5721                   }
5722
5723 if ((ret = thrift_protocol_read_string (protocol, &key27, error)) < 0)
5724                     return -1;

________________________________________________________________________________________________________
*** CID 1174587:  Logically dead code  (DEADCODE)
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 5728 in t_test_guess_protocol_struct_read()
5722
5723 if ((ret = thrift_protocol_read_string (protocol, &key27, error)) < 0)
5724                     return -1;
5725                   xfer += ret;
5726                   if (val28 != NULL)
5727                   {
    CID 1174587:  Logically dead code  (DEADCODE)
    Execution cannot reach this statement "g_free(val28);".
5728                     g_free(val28);
5729                     val28 = NULL;
5730                   }
5731
5732 if ((ret = thrift_protocol_read_string (protocol, &val28, error)) < 0)
5733                     return -1;

________________________________________________________________________________________________________
*** CID 1174576:  Logically dead code  (DEADCODE)
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 7477 in t_test_nested_mixedx2_read()
7471                     guint32 i;
7472                     for (i = 0; i < size; ++i)
7473                     {
7474                       gchar * _elem46 = NULL;
7475                       if (_elem46 != NULL)
7476                       {
    CID 1174576:  Logically dead code  (DEADCODE)
    Execution cannot reach this statement "g_free(_elem46);".
7477                         g_free(_elem46);
7478                         _elem46 = NULL;
7479                       }
7480
7481 if ((ret = thrift_protocol_read_string (protocol, &_elem46, error)) < 0)
7482                         return -1;

________________________________________________________________________________________________________
*** CID 1174575:  Logically dead code  (DEADCODE)
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 7554 in t_test_nested_mixedx2_read()
7548                         guint32 i;
7549                         for (i = 0; i < size; ++i)
7550                         {
7551                           gchar * _elem50 = NULL;
7552                           if (_elem50 != NULL)
7553                           {
    CID 1174575:  Logically dead code  (DEADCODE)
    Execution cannot reach this statement "g_free(_elem50);".
7554                             g_free(_elem50);
7555                             _elem50 = NULL;
7556                           }
7557
7558 if ((ret = thrift_protocol_read_string (protocol, &_elem50, error)) < 0)
7559                             return -1;

________________________________________________________________________________________________________
*** CID 1174553:  Logically dead code  (DEADCODE)
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 1762 in t_test_insanity_read()
1756                 guint32 i;
1757                 for (i = 0; i < size; i++)
1758                 {
1759                   TTestXtruct * _elem3 = NULL;
1760                   if ( _elem3 != NULL)
1761                   {
    CID 1174553:  Logically dead code  (DEADCODE)
    Execution cannot reach this statement "g_object_unref(_elem3);".
1762                     g_object_unref (_elem3);
1763                   }
1764                   _elem3 = g_object_new (T_TEST_TYPE_XTRUCT, NULL);
1765 if ((ret = thrift_struct_read (THRIFT_STRUCT (_elem3), protocol, error)) < 0)
1766                   {
1767                     g_object_unref (_elem3);

________________________________________________________________________________________________________
*** CID 1174552:  Logically dead code  (DEADCODE)
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 6126 in t_test_large_deltas_read()
6120                 guint32 i;
6121                 for (i = 0; i < size; ++i)
6122                 {
6123                   gchar * _elem29 = NULL;
6124                   if (_elem29 != NULL)
6125                   {
    CID 1174552:  Logically dead code  (DEADCODE)
    Execution cannot reach this statement "g_free(_elem29);".
6126                     g_free(_elem29);
6127                     _elem29 = NULL;
6128                   }
6129
6130 if ((ret = thrift_protocol_read_string (protocol, &_elem29, error)) < 0)
6131                     return -1;

________________________________________________________________________________________________________
*** CID 1174622:  Dereference before null check  (REVERSE_INULL)
/test/c_glib/gen-c_glib/t_test_second_service.c: 334 in t_test_second_service_client_recv_secondtest_string()
328         return FALSE;
329       } else if (strncmp (fname, "secondtestString", 16) != 0) {
330         thrift_protocol_skip (protocol, T_STRUCT, NULL);
331         thrift_protocol_read_message_end (protocol, error);
332         thrift_transport_read_end (protocol->transport, error);
333 g_set_error (error, THRIFT_APPLICATION_EXCEPTION_ERROR, THRIFT_APPLICATION_EXCEPTION_ERROR_WRONG_METHOD_NAME, "wrong method name %s, expected secondtestString", fname);
    CID 1174622:  Dereference before null check  (REVERSE_INULL)
Null-checking "fname" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
334         if (fname) g_free (fname);
335         return FALSE;
336       }
337       if (fname) g_free (fname);
338
339       {
/test/c_glib/gen-c_glib/t_test_second_service.c: 337 in t_test_second_service_client_recv_secondtest_string()
331         thrift_protocol_read_message_end (protocol, error);
332         thrift_transport_read_end (protocol->transport, error);
333 g_set_error (error, THRIFT_APPLICATION_EXCEPTION_ERROR, THRIFT_APPLICATION_EXCEPTION_ERROR_WRONG_METHOD_NAME, "wrong method name %s, expected secondtestString", fname);
334         if (fname) g_free (fname);
335         return FALSE;
336       }
    CID 1174622:  Dereference before null check  (REVERSE_INULL)
Null-checking "fname" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
337       if (fname) g_free (fname);
338
339       {
340         gint32 ret;
341         gint32 xfer = 0;
342         gchar *name = NULL;

________________________________________________________________________________________________________
*** CID 1174598:  Uninitialized pointer read  (UNINIT)
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 2466 in t_test_crazy_nesting_write()
2460               keys[i++] = (GHashTable *) iter->data;
2461             }
2462             g_list_free (key_list);
2463
2464             for (i = 0; i < key_count; ++i)
2465             {
    CID 1174598:  Uninitialized pointer read  (UNINIT)
    Using uninitialized value "keys[i]".
2466               key = keys[i];
2467 value = (GHashTable *) g_hash_table_lookup (((GHashTable *) ((GHashTable*)g_ptr_array_index ((GPtrArray *) this_object->list_field, i16))), (gpointer) key);
2468
2469               {
2470 if ((ret = thrift_protocol_write_set_begin (protocol, T_I32, (gint32) g_hash_table_size ((GHashTable *) key), error)) < 0)
2471                   return -1;
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 2489 in t_test_crazy_nesting_write()
2483                   keys[i++] = (gint32*) iter->data;
2484                 }
2485                 g_list_free (key_list);
2486
2487                 for (i=0; i<key_count; ++i)
2488                 {
    CID 1174598:  Uninitialized pointer read  (UNINIT)
    Using uninitialized value "keys[i]".
2489                   elem = keys[i];
2490 value = (gpointer) g_hash_table_lookup (((GHashTable *) key), (gpointer) elem);
2491
2492 if ((ret = thrift_protocol_write_i32 (protocol, *elem, error)) < 0)
2493                     return -1;
2494                 }
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 2518 in t_test_crazy_nesting_write()
2512                   keys[i++] = (gint32*) iter->data;
2513                 }
2514                 g_list_free (key_list);
2515
2516                 for (i = 0; i < key_count; ++i)
2517                 {
    CID 1174598:  Uninitialized pointer read  (UNINIT)
    Using uninitialized value "keys[i]".
2518                   key = keys[i];
2519 value = (GHashTable *) g_hash_table_lookup (((GHashTable *) value), (gpointer) key);
2520
2521 if ((ret = thrift_protocol_write_i32 (protocol, * key, error)) < 0)
2522                     return -1;
2523                   {
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 2543 in t_test_crazy_nesting_write()
2537                       keys[i++] = (GPtrArray *) iter->data;
2538                     }
2539                     g_list_free (key_list);
2540
2541                     for (i=0; i<key_count; ++i)
2542                     {
    CID 1174598:  Uninitialized pointer read  (UNINIT)
    Using uninitialized value "keys[i]".
2543                       elem = keys[i];
2544 value = (gpointer) g_hash_table_lookup (((GHashTable *) value), (gpointer) elem);
2545
2546                       {
2547 if ((ret = thrift_protocol_write_list_begin (protocol, T_MAP, (gint32) elem->len, error)) < 0)
2548                           return -1;
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 2572 in t_test_crazy_nesting_write()
2566                               keys[i++] = (TTestInsanity *) iter->data;
2567                             }
2568                             g_list_free (key_list);
2569
2570                             for (i = 0; i < key_count; ++i)
2571                             {
    CID 1174598:  Uninitialized pointer read  (UNINIT)
    Using uninitialized value "keys[i]".
2572                               key = keys[i];
2573 value = (gchar *) g_hash_table_lookup (((GHashTable *) ((GHashTable*)g_ptr_array_index ((GPtrArray *) elem, i17))), (gpointer) key);
2574
2575 if ((ret = thrift_struct_write (THRIFT_STRUCT ( key), protocol, error)) < 0)
2576                                 return -1;
2577                               xfer += ret;

________________________________________________________________________________________________________
*** CID 1174597:  Uninitialized pointer read  (UNINIT)
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 2507 in t_test_crazy_nesting_write()
2501                   return -1;
2502                 xfer += ret;
2503
2504                 GList *key_list = NULL, *iter = NULL;
2505                 gint32* key;
2506                 GHashTable * value;
    CID 1174597:  Uninitialized pointer read  (UNINIT)
Using uninitialized value "value" when calling "g_hash_table_foreach(GHashTable *, GHFunc, gpointer)".
2507 g_hash_table_foreach ((GHashTable *) value, thrift_hash_table_get_keys, &key_list);
2508                 gint32* keys[g_list_length (key_list)];
2509                 int i=0, key_count = g_list_length (key_list);
2510 for (iter = g_list_first (key_list); iter; iter = iter->next)
2511                 {
2512                   keys[i++] = (gint32*) iter->data;
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 2532 in t_test_crazy_nesting_write()
2526                     xfer += ret;
2527                     GList *key_list = NULL, *iter = NULL;
2528                     GPtrArray * elem;
2529                     gpointer value;
2530                     THRIFT_UNUSED_VAR (value);
2531
    CID 1174597:  Uninitialized pointer read  (UNINIT)
Using uninitialized value "value" when calling "g_hash_table_foreach(GHashTable *, GHFunc, gpointer)".
2532 g_hash_table_foreach ((GHashTable *) value, thrift_hash_table_get_keys, &key_list);
2533                     GPtrArray * keys[g_list_length (key_list)];
2534                     int i=0, key_count = g_list_length (key_list);
2535 for (iter = g_list_first (key_list); iter; iter = iter->next)
2536                     {
2537                       keys[i++] = (GPtrArray *) iter->data;

________________________________________________________________________________________________________
*** CID 1174593:  Uninitialized pointer read  (UNINIT)
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 7649 in t_test_nested_mixedx2_write()
7643               keys[i++] = (gint32*) iter->data;
7644             }
7645             g_list_free (key_list);
7646
7647             for (i=0; i<key_count; ++i)
7648             {
    CID 1174593:  Uninitialized pointer read  (UNINIT)
    Using uninitialized value "keys[i]".
7649               elem = keys[i];
7650 value = (gpointer) g_hash_table_lookup (((GHashTable *) ((GHashTable*)g_ptr_array_index ((GPtrArray *) this_object->int_set_list, i51))), (gpointer) elem);
7651
7652 if ((ret = thrift_protocol_write_i32 (protocol, *elem, error)) < 0)
7653                 return -1;
7654             }
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 7714 in t_test_nested_mixedx2_write()
7708               keys[i++] = (gchar *) iter->data;
7709             }
7710             g_list_free (key_list);
7711
7712             for (i=0; i<key_count; ++i)
7713             {
    CID 1174593:  Uninitialized pointer read  (UNINIT)
    Using uninitialized value "keys[i]".
7714               elem = keys[i];
7715 value = (gpointer) g_hash_table_lookup (((GHashTable *) value), (gpointer) elem);
7716
7717 if ((ret = thrift_protocol_write_string (protocol, elem, error)) < 0)
7718                 return -1;
7719             }
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 7761 in t_test_nested_mixedx2_write()
7755               keys[i++] = (gint32*) iter->data;
7756             }
7757             g_list_free (key_list);
7758
7759             for (i = 0; i < key_count; ++i)
7760             {
    CID 1174593:  Uninitialized pointer read  (UNINIT)
    Using uninitialized value "keys[i]".
7761               key = keys[i];
7762 value = (GHashTable *) g_hash_table_lookup (((GHashTable *) ((GHashTable*)g_ptr_array_index ((GPtrArray *) this_object->map_int_strset_list, i52))), (gpointer) key);
7763
7764 if ((ret = thrift_protocol_write_i32 (protocol, * key, error)) < 0)
7765                 return -1;
7766               {
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 7786 in t_test_nested_mixedx2_write()
7780                   keys[i++] = (gchar *) iter->data;
7781                 }
7782                 g_list_free (key_list);
7783
7784                 for (i=0; i<key_count; ++i)
7785                 {
    CID 1174593:  Uninitialized pointer read  (UNINIT)
    Using uninitialized value "keys[i]".
7786                   elem = keys[i];
7787 value = (gpointer) g_hash_table_lookup (((GHashTable *) value), (gpointer) elem);
7788
7789 if ((ret = thrift_protocol_write_string (protocol, elem, error)) < 0)
7790                     return -1;
7791                 }

________________________________________________________________________________________________________
*** CID 1174592:  Uninitialized pointer read  (UNINIT)
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 7703 in t_test_nested_mixedx2_write()
7697             xfer += ret;
7698             GList *key_list = NULL, *iter = NULL;
7699             gchar * elem;
7700             gpointer value;
7701             THRIFT_UNUSED_VAR (value);
7702
    CID 1174592:  Uninitialized pointer read  (UNINIT)
Using uninitialized value "value" when calling "g_hash_table_foreach(GHashTable *, GHFunc, gpointer)".
7703 g_hash_table_foreach ((GHashTable *) value, thrift_hash_table_get_keys, &key_list);
7704             gchar * keys[g_list_length (key_list)];
7705             int i=0, key_count = g_list_length (key_list);
7706 for (iter = g_list_first (key_list); iter; iter = iter->next)
7707             {
7708               keys[i++] = (gchar *) iter->data;
/test/c_glib/gen-c_glib/t_test_thrift_test_types.c: 7775 in t_test_nested_mixedx2_write()
7769                 xfer += ret;
7770                 GList *key_list = NULL, *iter = NULL;
7771                 gchar * elem;
7772                 gpointer value;
7773                 THRIFT_UNUSED_VAR (value);
7774
    CID 1174592:  Uninitialized pointer read  (UNINIT)
Using uninitialized value "value" when calling "g_hash_table_foreach(GHashTable *, GHFunc, gpointer)".
7775 g_hash_table_foreach ((GHashTable *) value, thrift_hash_table_get_keys, &key_list);
7776                 gchar * keys[g_list_length (key_list)];
7777                 int i=0, key_count = g_list_length (key_list);
7778 for (iter = g_list_first (key_list); iter; iter = iter->next)
7779                 {
7780                   keys[i++] = (gchar *) iter->data;


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, http://scan.coverity.com/projects/1345?tab=overview

To unsubscribe from the email notification for new defects, http://scan5.coverity.com/cgi-bin/unsubscribe.py



Reply via email to