Re: [PATCH 3/5] Add a ckpt_read_string() function to allow reading of a variable-length (but length-capped) string from the checkpoint stream.

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

 



OL> You can avoid the memcpy() if you first read only the header, allocate
OL> the string, and then read data into it.

I've changed it to a _ckpt_read_obj_type(.., NULL, ..) and a
ckpt_kread() to avoid the memcpy().

OL> On top of this you can have ckpt_read_string() that will verify that
OL> the buffer is of non-zero length and null terminated ?

What I had ensured a null-terminated string (kzalloc() and len+1). 

Is this really the appropriate place to ensure that the string is
non-zero length?  Maybe not in the realm of paths and socket names,
but I can see other places where writing a zero-length string might be
appropriate...

-- 
Dan Smith
IBM Linux Technology Center
email: danms@xxxxxxxxxx
_______________________________________________
Containers mailing list
Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/containers

[Index of Archives]     [Cgroups]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux