From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oren Laadan Subject: Re: [PATCH 1/2] Ensure nul-termination of file names read from checkpoint images Date: Fri, 23 Oct 2009 20:29:53 -0400 Message-ID: <4AE24A81.7030603@librato.com> References: <4AE248FC.5000401@librato.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4AE248FC.5000401-RdfvBDnrOixBDgjK7y7TUQ@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Matt Helsley Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org List-Id: containers.vger.kernel.org Oren Laadan wrote: > > Matt Helsley wrote: >> Don't rely on the checkpoint image to properly terminate the filename. >> Passing PATH_MAX + 1 won't work since it's a maximum -- not the number >> of bytes to allocate. Allocate space for the string, copy an amount >> according to the header length (limited to < PATH_MAX), and ensure that >> it's nul-terminated. >> >> Signed-off-by: Matt Helsley > > I dislike unneeded data copy. > See ckpt_read_string() and ckpt_read_payload(). > No need to resend -- I'll do the fix. Oren.