Re: String manipulation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Missed to click "reply all" earlier :)

On Thu, Nov 2, 2017 at 9:34 PM, Xavi Hernandez <jahernan@xxxxxxxxxx> wrote:
Hi Atin,

On 2 November 2017 at 16:31, Atin Mukherjee <atin.mukherjee83@xxxxxxxxx> wrote:


On Thu, Nov 2, 2017 at 3:35 PM, Xavi Hernandez <jahernan@xxxxxxxxxx> 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

 

Xavi



_______________________________________________
Gluster-devel mailing list
Gluster-devel@xxxxxxxxxxx
http://lists.gluster.org/mailman/listinfo/gluster-devel



_______________________________________________
Gluster-devel mailing list
Gluster-devel@xxxxxxxxxxx
http://lists.gluster.org/mailman/listinfo/gluster-devel

[Index of Archives]     [Gluster Users]     [Ceph Users]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux