[Gluster-devel] New Defects reported by Coverity Scan for gluster/glusterfs

scan-admin at coverity.com scan-admin at coverity.com
Mon Feb 22 07:31:25 UTC 2016


Hi,

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

71 new defect(s) introduced to gluster/glusterfs found with Coverity Scan.
76 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 20 of 71 defect(s)


** CID 1351709:    (USE_AFTER_FREE)
/data/workspace/gluster/glusterfs/xlators/cluster/ec/src/ec-inode-write.c: 1380 in ec_writev_start()
/data/workspace/gluster/glusterfs/xlators/cluster/ec/src/ec-inode-write.c: 1380 in ec_writev_start()


________________________________________________________________________________________________________
*** CID 1351709:    (USE_AFTER_FREE)
/data/workspace/gluster/glusterfs/xlators/cluster/ec/src/ec-inode-write.c: 1380 in ec_writev_start()
1374                 dict_unref (xdata);
1375     
1376         return;
1377     
1378     out:
1379         if (iobuf != NULL) {
>>>     CID 1351709:    (USE_AFTER_FREE)
>>>     Calling "iobuf_unref" frees pointer "iobuf" which has already been freed.
1380             iobuf_unref(iobuf);
1381         }
1382         if (iobref != NULL) {
1383             iobref_unref(iobref);
1384         }
1385     
/data/workspace/gluster/glusterfs/xlators/cluster/ec/src/ec-inode-write.c: 1380 in ec_writev_start()
1374                 dict_unref (xdata);
1375     
1376         return;
1377     
1378     out:
1379         if (iobuf != NULL) {
>>>     CID 1351709:    (USE_AFTER_FREE)
>>>     Passing freed pointer "iobuf" as an argument to "iobuf_unref".
1380             iobuf_unref(iobuf);
1381         }
1382         if (iobref != NULL) {
1383             iobref_unref(iobref);
1384         }
1385     

** CID 1351708:  Memory - illegal accesses  (USE_AFTER_FREE)
/data/workspace/gluster/glusterfs/xlators/mgmt/glusterd/src/glusterd-utils.c: 6971 in glusterd_friend_remove_cleanup_vols()


________________________________________________________________________________________________________
*** CID 1351708:  Memory - illegal accesses  (USE_AFTER_FREE)
/data/workspace/gluster/glusterfs/xlators/mgmt/glusterd/src/glusterd-utils.c: 6971 in glusterd_friend_remove_cleanup_vols()
6965                                             GD_MSG_STALE_VOL_REMOVE_FAIL,
6966                                             "Error deleting stale volume");
6967                                     goto out;
6968                             }
6969                     }
6970     
>>>     CID 1351708:  Memory - illegal accesses  (USE_AFTER_FREE)
>>>     Passing freed pointer "volinfo" as an argument to "glusterd_friend_contains_vol_bricks".
6971                     if (!glusterd_friend_contains_vol_bricks (volinfo,
6972                                                               MY_UUID)) {
6973                             /*Stop snapd daemon service if snapd daemon is running*/
6974                             if (!volinfo->is_snap_volume) {
6975                                     svc = &(volinfo->snapd.svc);
6976                                     ret = svc->stop (svc, SIGTERM);

** CID 1351707:  Code maintainability issues  (UNUSED_VALUE)
/data/workspace/gluster/glusterfs/xlators/storage/posix/src/posix.c: 1898 in posix_unlink()


________________________________________________________________________________________________________
*** CID 1351707:  Code maintainability issues  (UNUSED_VALUE)
/data/workspace/gluster/glusterfs/xlators/storage/posix/src/posix.c: 1898 in posix_unlink()
1892                             op_errno = errno;
1893                             gf_msg (this->name, GF_LOG_ERROR, errno,
1894                                     P_MSG_FSTAT_FAILED, "post operation "
1895                                     "fstat failed on fd=%d", fd);
1896                             goto out;
1897                     }
>>>     CID 1351707:  Code maintainability issues  (UNUSED_VALUE)
>>>     Assigning value from "posix_set_iatt_in_dict(unwind_dict, &postbuf)" to "op_ret" here, but that stored value is overwritten before it can be used.
1898                     op_ret = posix_set_iatt_in_dict (unwind_dict, &postbuf);
1899             }
1900     
1901             op_ret = posix_pstat (this, loc->pargfid, par_path, &postparent);
1902             if (op_ret == -1) {
1903                     op_errno = errno;

** CID 1351706:  Code maintainability issues  (UNUSED_VALUE)
/data/workspace/gluster/glusterfs/xlators/mgmt/glusterd/src/glusterd-quota.c: 1528 in glusterd_op_quota()


________________________________________________________________________________________________________
*** CID 1351706:  Code maintainability issues  (UNUSED_VALUE)
/data/workspace/gluster/glusterfs/xlators/mgmt/glusterd/src/glusterd-quota.c: 1528 in glusterd_op_quota()
1522                     gf_msg (this->name, GF_LOG_ERROR, 0,
1523                             GD_MSG_VOLFILE_CREATE_FAIL, "Unable to re-create "
1524                                                       "volfiles");
1525                     if (GF_QUOTA_OPTION_TYPE_ENABLE == type) {
1526                             /* rollback volinfo */
1527                             volinfo->quota_xattr_version--;
>>>     CID 1351706:  Code maintainability issues  (UNUSED_VALUE)
>>>     Assigning value from "glusterd_store_volinfo(volinfo, GLUSTERD_VOLINFO_VER_AC_INCREMENT)" to "ret" here, but that stored value is overwritten before it can be used.
1528                             ret = glusterd_store_volinfo (volinfo,
1529                                           GLUSTERD_VOLINFO_VER_AC_INCREMENT);
1530                     }
1531     
1532                     ret = -1;
1533                     goto out;

** CID 1351705:  Code maintainability issues  (UNUSED_VALUE)
/data/workspace/gluster/glusterfs/xlators/cluster/afr/src/afr-self-heal-data.c: 94 in __afr_can_skip_data_block_heal()


________________________________________________________________________________________________________
*** CID 1351705:  Code maintainability issues  (UNUSED_VALUE)
/data/workspace/gluster/glusterfs/xlators/cluster/afr/src/afr-self-heal-data.c: 94 in __afr_can_skip_data_block_heal()
88     	int i = 0;
89     
90     	priv = this->private;
91     	local = frame->local;
92             xdata = dict_new();
93             if (xdata)
>>>     CID 1351705:  Code maintainability issues  (UNUSED_VALUE)
>>>     Assigning value from "dict_set_int32(xdata, "check-zero-filled", 1)" to "i" here, but that stored value is overwritten before it can be used.
94                     i = dict_set_int32 (xdata, "check-zero-filled", 1);
95     	wind_subvols = alloca0 (priv->child_count);
96     	for (i = 0; i < priv->child_count; i++) {
97     		if (i == source || healed_sinks[i])
98     			wind_subvols[i] = 1;
99     	}

** CID 1351704:  Code maintainability issues  (UNUSED_VALUE)
/data/workspace/gluster/glusterfs/xlators/features/marker/src/marker.c: 3317 in init()


________________________________________________________________________________________________________
*** CID 1351704:  Code maintainability issues  (UNUSED_VALUE)
/data/workspace/gluster/glusterfs/xlators/features/marker/src/marker.c: 3317 in init()
3311                     if (ret == 0 && flag == _gf_true)
3312                             priv->feature_enabled |= GF_INODE_QUOTA;
3313             }
3314     
3315             data = dict_get (options, "quota-version");
3316             if (data)
>>>     CID 1351704:  Code maintainability issues  (UNUSED_VALUE)
>>>     Assigning value from "gf_string2int32(data->data, &priv->version)" to "ret" here, but that stored value is overwritten before it can be used.
3317                     ret = gf_string2int32 (data->data, &priv->version);
3318     
3319             if (priv->feature_enabled && priv->version < 0) {
3320                     gf_log (this->name, GF_LOG_ERROR, "Invalid quota version %d",
3321                             priv->version);
3322                     goto err;

** CID 1351703:  Code maintainability issues  (UNUSED_VALUE)
/data/workspace/gluster/glusterfs/xlators/features/changetimerecorder/src/ctr-helper.h: 283 in set_posix_link_request()


________________________________________________________________________________________________________
*** CID 1351703:  Code maintainability issues  (UNUSED_VALUE)
/data/workspace/gluster/glusterfs/xlators/features/changetimerecorder/src/ctr-helper.h: 283 in set_posix_link_request()
277             GF_VALIDATE_OR_GOTO (this->name, xdata, out);
278     
279             /*create xdata if NULL*/
280             if (!*xdata) {
281                     *xdata = dict_new();
282                     is_created = _gf_true;
>>>     CID 1351703:  Code maintainability issues  (UNUSED_VALUE)
>>>     Assigning value "1" to "ret" here, but that stored value is overwritten before it can be used.
283                     ret = 1;
284             } else {
285                     ret = 0;
286             }
287     
288             if (!*xdata) {

** CID 1351702:  Code maintainability issues  (UNUSED_VALUE)
/data/workspace/gluster/glusterfs/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c: 3695 in glusterd_copy_nfs_ganesha_file()


________________________________________________________________________________________________________
*** CID 1351702:  Code maintainability issues  (UNUSED_VALUE)
/data/workspace/gluster/glusterfs/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c: 3695 in glusterd_copy_nfs_ganesha_file()
3689     
3690             GF_VALIDATE_OR_GOTO (this->name, src_vol, out);
3691             GF_VALIDATE_OR_GOTO (this->name, dest_vol, out);
3692     
3693             if (src_vol->is_snap_volume) {
3694                     GLUSTERD_GET_SNAP_DIR (snap_dir, src_vol->snapshot, priv);
>>>     CID 1351702:  Code maintainability issues  (UNUSED_VALUE)
>>>     Assigning value from "snprintf(src_path, 4096UL, "%s/export.%s.conf", snap_dir, src_vol->snapshot->snapname)" to "ret" here, but that stored value is overwritten before it can be used.
3695                     ret = snprintf (src_path, sizeof (src_path),
3696                                     "%s/export.%s.conf", snap_dir,
3697                                     src_vol->snapshot->snapname);
3698             } else {
3699                     ret = snprintf (src_path, sizeof (src_path),
3700                                     "%s/export.%s.conf", GANESHA_EXPORT_DIRECTORY,

** CID 1351701:  Control flow issues  (UNREACHABLE)
/data/workspace/gluster/glusterfs/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c: 2758 in glusterd_volume_quorum_calculate()


________________________________________________________________________________________________________
*** CID 1351701:  Control flow issues  (UNREACHABLE)
/data/workspace/gluster/glusterfs/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c: 2758 in glusterd_volume_quorum_calculate()
2752                     goto out;
2753             } else {
2754                     quorum_met = _gf_true;
2755                     goto out;
2756             }
2757     
>>>     CID 1351701:  Control flow issues  (UNREACHABLE)
>>>     This code cannot be reached: "up_count = volinfo->dist_le...".
2758             up_count = volinfo->dist_leaf_count - down_count;
2759     
2760             if (quorum_type && !strcmp (quorum_type, "fixed")) {
2761                     if (up_count >= quorum_count) {
2762                             quorum_met = _gf_true;
2763                             goto out;

** CID 1351700:  Incorrect expression  (UNINTENDED_INTEGER_DIVISION)
/data/workspace/gluster/glusterfs/xlators/cluster/dht/src/dht-selfheal.c: 1645 in dht_selfheal_layout_new_directory()


________________________________________________________________________________________________________
*** CID 1351700:  Incorrect expression  (UNINTENDED_INTEGER_DIVISION)
/data/workspace/gluster/glusterfs/xlators/cluster/dht/src/dht-selfheal.c: 1645 in dht_selfheal_layout_new_directory()
1639                     gf_msg_debug (this->name, 0,
1640                                   "chunk size = 0xffffffff / %lu = %f",
1641                                   total_size, chunk);
1642             }
1643             else {
1644                     weight_by_size = _gf_false;
>>>     CID 1351700:  Incorrect expression  (UNINTENDED_INTEGER_DIVISION)
>>>     Dividing integer expressions "4294967295UL" and "bricks_to_use", and then converting the integer quotient to type "double". Any remainder, or fractional part of the quotient, is ignored.
1645                     chunk = ((unsigned long) 0xffffffff) / bricks_to_use;
1646             }
1647     
1648             start_subvol = dht_selfheal_layout_alloc_start (this, loc, layout);
1649     
1650             /* clear out the range, as we are re-computing here */

** CID 1351699:    (TAINTED_SCALAR)
/data/workspace/gluster/glusterfs/libglusterfs/src/gfdb/gfdb_data_store_helper.c: 578 in gfdb_read_query_record()


________________________________________________________________________________________________________
*** CID 1351699:    (TAINTED_SCALAR)
/data/workspace/gluster/glusterfs/libglusterfs/src/gfdb/gfdb_data_store_helper.c: 578 in gfdb_read_query_record()
572             }
573     
574     
575             /* Read the serialized query record from file */
576             read_len = buffer_len;
577             read_buffer = buffer;
>>>     CID 1351699:    (TAINTED_SCALAR)
>>>     Using tainted variable "read_len" as a loop boundary.
578             while ((ret = sys_read (fd, read_buffer, read_len)) < read_len) {
579     
580                     /*Any error */
581                     if (ret < 0) {
582                             gf_msg (GFDB_DATA_STORE, GF_LOG_ERROR, errno,
583                                     LG_MSG_DB_ERROR, "Failed to read serialized "
/data/workspace/gluster/glusterfs/libglusterfs/src/gfdb/gfdb_data_store_helper.c: 566 in gfdb_read_query_record()
560             else if (ret == 0) {
561                     ret = 0;
562                     goto out;
563             }
564     
565             /* Allocating memory to the serialization buffer */
>>>     CID 1351699:    (TAINTED_SCALAR)
>>>     Passing tainted variable "buffer_len" to a tainted sink.
566             buffer = GF_CALLOC (1, buffer_len,  gf_common_mt_char);
567             if (!buffer) {
568                     gf_msg (GFDB_DATA_STORE, GF_LOG_ERROR, 0,
569                             LG_MSG_DB_ERROR, "Failed to allocate space to "
570                             "serialized buffer");
571                     goto out;

** CID 1351698:    (TAINTED_SCALAR)
/data/workspace/gluster/glusterfs/xlators/mgmt/glusterd/src/glusterd-ganesha.c: 67 in parsing_ganesha_ha_conf()
/data/workspace/gluster/glusterfs/xlators/mgmt/glusterd/src/glusterd-ganesha.c: 65 in parsing_ganesha_ha_conf()


________________________________________________________________________________________________________
*** CID 1351698:    (TAINTED_SCALAR)
/data/workspace/gluster/glusterfs/xlators/mgmt/glusterd/src/glusterd-ganesha.c: 67 in parsing_ganesha_ha_conf()
61                             GD_MSG_NO_MEMORY, "alloc for reading file failed");
62                     goto end_close;
63             }
64     
65             while (fgets (line, st.st_size, fp) != NULL) {
66                     /* Read config file until we get matching "^[[:space:]]*key" */
>>>     CID 1351698:    (TAINTED_SCALAR)
>>>     Assigning: "pointer" = "line". Both are now tainted.
67                     pointer = line;
68                     if (*pointer == '#') {
69                             continue;
70                     }
71                     while (isblank(*pointer)) {
72                             pointer++;
/data/workspace/gluster/glusterfs/xlators/mgmt/glusterd/src/glusterd-ganesha.c: 65 in parsing_ganesha_ha_conf()
59             if (line == NULL) {
60                     gf_msg (THIS->name, GF_LOG_ERROR, errno,
61                             GD_MSG_NO_MEMORY, "alloc for reading file failed");
62                     goto end_close;
63             }
64     
>>>     CID 1351698:    (TAINTED_SCALAR)
>>>     Calling function "fgets" taints argument "line".
65             while (fgets (line, st.st_size, fp) != NULL) {
66                     /* Read config file until we get matching "^[[:space:]]*key" */
67                     pointer = line;
68                     if (*pointer == '#') {
69                             continue;
70                     }

** CID 1351697:  Memory - corruptions  (STRING_OVERFLOW)
/data/workspace/gluster/glusterfs/xlators/mgmt/glusterd/src/glusterd-volgen.c: 3695 in volume_volgen_graph_build_clusters()


________________________________________________________________________________________________________
*** CID 1351697:  Memory - corruptions  (STRING_OVERFLOW)
/data/workspace/gluster/glusterfs/xlators/mgmt/glusterd/src/glusterd-volgen.c: 3695 in volume_volgen_graph_build_clusters()
3689             dist_count = volinfo->brick_count / volinfo->dist_leaf_count;
3690             if (!dist_count) {
3691                     ret = -1;
3692                     goto out;
3693             }
3694             if (volinfo->tier_info.hot_brick_count) {
>>>     CID 1351697:  Memory - corruptions  (STRING_OVERFLOW)
>>>     You might overrun the 256 byte destination string "tmp_volname" by writing 261 bytes from "volinfo->volname".
3695                     strcpy (tmp_volname, volinfo->volname);
3696                     if (volinfo->tier_info.cur_tier_hot)
3697                             strcat (volinfo->volname, "-hot");
3698                     else
3699                             strcat (volinfo->volname, "-cold");
3700             }

** CID 1351696:  Security best practices violations  (STRING_OVERFLOW)
/data/workspace/gluster/glusterfs/xlators/features/changetimerecorder/src/changetimerecorder.c: 129 in ctr_lookup_wind()


________________________________________________________________________________________________________
*** CID 1351696:  Security best practices violations  (STRING_OVERFLOW)
/data/workspace/gluster/glusterfs/xlators/features/changetimerecorder/src/changetimerecorder.c: 129 in ctr_lookup_wind()
123                     CTR_DB_REC(ctr_local).gfdb_fop_path = ctr_inode_cx->fop_path;
124                     CTR_DB_REC(ctr_local).gfdb_fop_type = ctr_inode_cx->fop_type;
125     
126                     /* Copy hard link info*/
127                     gf_uuid_copy (CTR_DB_REC(ctr_local).pargfid,
128                             *((NEW_LINK_CX(ctr_inode_cx))->pargfid));
>>>     CID 1351696:  Security best practices violations  (STRING_OVERFLOW)
>>>     You might overrun the 256 byte fixed-size string "ctr_local->gfdb_db_record.file_name" by copying "ctr_inode_cx->new_link_cx->basename" without checking the length.
129                     strcpy (CTR_DB_REC(ctr_local).file_name,
130                             NEW_LINK_CX(ctr_inode_cx)->basename);
131     
132                     /* Since we are in lookup we can ignore errors while
133                      * Inserting in the DB, because there may be many
134                      * to write to the DB attempts for healing.

** CID 1351695:  Security best practices violations  (STRING_OVERFLOW)
/data/workspace/gluster/glusterfs/xlators/mgmt/glusterd/src/glusterd-utils.c: 735 in glusterd_create_sub_tier_volinfo()


________________________________________________________________________________________________________
*** CID 1351695:  Security best practices violations  (STRING_OVERFLOW)
/data/workspace/gluster/glusterfs/xlators/mgmt/glusterd/src/glusterd-utils.c: 735 in glusterd_create_sub_tier_volinfo()
729             (*dup_volinfo)->status           = volinfo->status;
730             (*dup_volinfo)->snapshot         = volinfo->snapshot;
731     
732             memcpy (&(*dup_volinfo)->tier_info, &volinfo->tier_info,
733                     sizeof (volinfo->tier_info));
734     
>>>     CID 1351695:  Security best practices violations  (STRING_OVERFLOW)
>>>     Note: This defect has an elevated risk because the source argument is a parameter of the current function.
735             strcpy ((*dup_volinfo)->volname, new_volname);
736     
737             cds_list_for_each_entry (brickinfo, &volinfo->bricks, brick_list) {
738                     i++;
739     
740                     if (is_hot_tier) {

** CID 1351694:  Null pointer dereferences  (REVERSE_INULL)
/data/workspace/gluster/glusterfs/glusterfsd/src/glusterfsd-mgmt.c: 1838 in glusterfs_rebalance_event_notify_cbk()


________________________________________________________________________________________________________
*** CID 1351694:  Null pointer dereferences  (REVERSE_INULL)
/data/workspace/gluster/glusterfs/glusterfsd/src/glusterfsd-mgmt.c: 1838 in glusterfs_rebalance_event_notify_cbk()
1832                     ret = -1;
1833                     goto out;
1834             }
1835     out:
1836             free (rsp.dict.dict_val); //malloced by xdr
1837     
>>>     CID 1351694:  Null pointer dereferences  (REVERSE_INULL)
>>>     Null-checking "frame" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
1838             if (frame) {
1839                     STACK_DESTROY (frame->root);
1840             }
1841     
1842             return ret;
1843     

** CID 1351693:    (REVERSE_INULL)
/data/workspace/gluster/glusterfs/xlators/debug/io-stats/src/io-stats.c: 730 in _io_stats_get_key_prefix()
/data/workspace/gluster/glusterfs/xlators/debug/io-stats/src/io-stats.c: 745 in _io_stats_get_key_prefix()


________________________________________________________________________________________________________
*** CID 1351693:    (REVERSE_INULL)
/data/workspace/gluster/glusterfs/xlators/debug/io-stats/src/io-stats.c: 730 in _io_stats_get_key_prefix()
724             if (instance_name) {
725                     /* +3 for 2 x "." + NULL */
726                     key_len = strlen (key_root) + strlen (xlator_name) +
727                             strlen (instance_name) + 3;
728                     *key_prefix = GF_CALLOC (key_len, sizeof (char),
729                             gf_common_mt_char);
>>>     CID 1351693:    (REVERSE_INULL)
>>>     Null-checking "key_prefix" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
730                     if (!key_prefix) {
731                             ret = -ENOMEM;
732                             goto err;
733                     }
734                     bytes_written = snprintf (*key_prefix, key_len, "%s.%s.%s",
735                             key_root, xlator_name, instance_name);
/data/workspace/gluster/glusterfs/xlators/debug/io-stats/src/io-stats.c: 745 in _io_stats_get_key_prefix()
739                     }
740             } else {
741                     /* +2 for 1 x "." + NULL */
742                     key_len = strlen (key_root) + strlen (xlator_name) + 2;
743                     *key_prefix = GF_CALLOC (key_len, sizeof (char),
744                             gf_common_mt_char);
>>>     CID 1351693:    (REVERSE_INULL)
>>>     Null-checking "key_prefix" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
745                     if (!key_prefix) {
746                             ret = -ENOMEM;
747                             goto err;
748                     }
749                     bytes_written = snprintf (*key_prefix, key_len, "%s.%s",
750                             key_root, xlator_name);

** CID 1351692:  Null pointer dereferences  (REVERSE_INULL)
/data/workspace/gluster/glusterfs/xlators/debug/io-stats/src/io-stats.c: 712 in _io_stats_get_key_prefix()


________________________________________________________________________________________________________
*** CID 1351692:  Null pointer dereferences  (REVERSE_INULL)
/data/workspace/gluster/glusterfs/xlators/debug/io-stats/src/io-stats.c: 712 in _io_stats_get_key_prefix()
706             for (i = 0; i < strlen (xlator_name); i++) {
707                     if (xlator_name[i] == '/')
708                             xlator_name[i] = '_';
709             }
710     
711             instance_name = this->instance_name;
>>>     CID 1351692:  Null pointer dereferences  (REVERSE_INULL)
>>>     Null-checking "this->name" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
712             if (this->name && strcmp (this->name, "glustershd") == 0) {
713                     xlator_name = "shd";
714             } else if (this->prev &&
715                        strcmp (this->prev->name, "nfs-server") == 0) {
716                     xlator_name = "nfsd";
717                     if (this->prev->instance_name)

** CID 1351691:  Null pointer dereferences  (REVERSE_INULL)
/data/workspace/gluster/glusterfs/libglusterfs/src/common-utils.c: 473 in gf_rev_dns_lookup_cached()


________________________________________________________________________________________________________
*** CID 1351691:  Null pointer dereferences  (REVERSE_INULL)
/data/workspace/gluster/glusterfs/libglusterfs/src/common-utils.c: 473 in gf_rev_dns_lookup_cached()
467     
468                     if (!entry) {
469                             goto out;
470                     }
471                     entry->fqdn = fqdn;
472                     entry->ip = gf_strdup (ip);
>>>     CID 1351691:  Null pointer dereferences  (REVERSE_INULL)
>>>     Null-checking "ip" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
473                     if (!ip) {
474                             gf_dnscache_entry_deinit (entry);
475                             goto out;
476                     }
477                     entry->timestamp = time (NULL);
478     

** CID 1351690:  Null pointer dereferences  (REVERSE_INULL)
/data/workspace/gluster/glusterfs/api/src/glfs-fops.c: 810 in glfs_io_async_cbk()


________________________________________________________________________________________________________
*** CID 1351690:  Null pointer dereferences  (REVERSE_INULL)
/data/workspace/gluster/glusterfs/api/src/glfs-fops.c: 810 in glfs_io_async_cbk()
804             }
805     
806             /* Since the async operation is complete
807              * release the ref taken during the start
808              * of async operation
809              */
>>>     CID 1351690:  Null pointer dereferences  (REVERSE_INULL)
>>>     Null-checking "gio->glfd" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
810             if (gio->glfd)
811                     GF_REF_PUT (gio->glfd);
812     
813     	GF_FREE (gio->iov);
814     	GF_FREE (gio);
815     


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://scan.coverity.com/projects/gluster-glusterfs?tab=overview

To manage Coverity Scan email notifications for "gluster-devel at gluster.org", click https://scan.coverity.com/subscriptions/edit?email=gluster-devel%40gluster.org&token=7dffab14bc5a7180e75b0d047539f148



More information about the Gluster-devel mailing list