[Gluster-devel] String manipulation

Atin Mukherjee atin.mukherjee83 at gmail.com
Thu Nov 2 16:14:22 UTC 2017


Missed to click "reply all" earlier :)

On Thu, Nov 2, 2017 at 9:34 PM, Xavi Hernandez <jahernan at redhat.com> wrote:

> Hi Atin,
>
> On 2 November 2017 at 16:31, Atin Mukherjee <atin.mukherjee83 at gmail.com>
> wrote:
>
>>
>>
>> On Thu, Nov 2, 2017 at 3:35 PM, Xavi Hernandez <jahernan at redhat.com>
>> wrote:
>>
>>> Hi all,
>>>
>>> Several times I've seen issues with the way strings are handled in many
>>> parts of the code. Sometimes it's because of an incorrect use of some
>>> functions, like strncat(). Others it's because of a lack of error
>>> conditions check. Others it's a failure in allocating the right amount of
>>> memory, or even creating a big array in the stack.
>>>
>>> Maybe we should create a set of library functions to work with strings
>>> to hide all these details and make it easier (and less error prone) to
>>> manipulate strings. I've something already written some time ago that I can
>>> adapt to gluster.
>>>
>>> On top of that we could expand it by adding path manipulation functions
>>> and string parsing features.
>>>
>>
>>> Do you think it's worth it ?
>>>
>>
>> +1, one of the the major offender I see is strncpy () where it has been
>> handled differently across the code base.
>>
>>
> I've just created a GitHub issue [1] to track this.
>
> Xavi
>
> [1] https://github.com/gluster/glusterfs/issues/348
>
>
>>
>>> Xavi
>>>
>>>
>>>
>>> _______________________________________________
>>> Gluster-devel mailing list
>>> Gluster-devel at gluster.org
>>> http://lists.gluster.org/mailman/listinfo/gluster-devel
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gluster.org/pipermail/gluster-devel/attachments/20171102/83a89850/attachment.html>


More information about the Gluster-devel mailing list