[Gluster-devel] Question on dht_filter_loc_subvol_key() function (in dht-helper.c)

Yaniv Kaul ykaul at redhat.com
Fri Oct 4 07:45:37 UTC 2019

I'm reading the function, and unsure what's going on there, perhaps I'm
missing something:
name_len = strlen(loc->name) - keylen;
new_name = GF_MALLOC(name_len + 1, gf_common_mt_char);
snprintf(new_name, name_len + 1, "%s", loc->name);

How exactly is there enough space to snprintf loc->name into new_name?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gluster.org/pipermail/gluster-devel/attachments/20191004/74bdde6c/attachment.html>

More information about the Gluster-devel mailing list