Re: [edk2] ShellPkg: Refactor string manipulation in commands (#6)

Subject: Re: [edk2] ShellPkg: Refactor string manipulation in commands (#6)

From: "Carsey, Jaben" <jaben.carsey@intel.com>

To: Scott Duplichan <scott@notabs.org>, "edk2-devel@lists.sourceforge.net" <edk2-devel@lists.sourceforge.net>

Date: 2014-09-03 01:10:22

Good point.

Do you want to submit a patch?

> -----Original Message-----
> From: Scott Duplichan [mailto:scott@notabs.org]
> Sent: Saturday, August 30, 2014 10:10 PM
> To: edk2-devel@lists.sourceforge.net; Carsey, Jaben
> Subject: RE: [edk2] ShellPkg: Refactor string manipulation in commands (#6)
> Importance: High
> 
> Though I didn't confirm this with a debugger, it looks like the terminating null
> character could be lost in the last two StrCpy => StrnCpy changes in this
> patch:
> 
> -      StrCpy (ConfigResp, ConfigHdr);
> +      StrnCpy (ConfigResp, ConfigHdr, Length + NIC_ITEM_CONFIG_SIZE * 2
> + + 100);
> 
> ConfigResp is created by AllocateZeroPool, so the null terminator is there
> initially. But doesn't StrnCpy arg 3 need a -1 to keep it from being
> overwritten?
> 
> Thanks,
> Scott
> 
> 
> -----Original Message-----
> From: Bjorge, Erik C [mailto:erik.c.bjorge@intel.com]
> Sent: Friday, August 29, 2014 05:02 PM
> To: Carsey, Jaben
> Cc: edk2-devel@lists.sourceforge.net
> Subject: Re: [edk2] ShellPkg: Refactor string manipulation in commands (#6)
> 
> Reviewed-by: Erik Bjorge 
> 
> -----Original Message-----
> From: Carsey, Jaben
> Sent: Friday, August 29, 2014 3:00 PM
> To: Bjorge, Erik C
> Cc: edk2-devel@lists.sourceforge.net; Carsey, Jaben
> Subject: ShellPkg: Refactor string manipulation in commands (#6)
> 
> Erik,
> 
> Can you verify please?
> 
> This patch replaces StrCpy with StrnCpy or refactors out the usage of StrCpy
> through some other means.
> This patch replaces StrCat with StrnCat or refactors out the usage of StrCat
> through some other means.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jaben Carsey 
> 
> 
> ------------------------------------------------------------------------------
> Slashdot TV.
> Video for Nerds.  Stuff that matters.
> http://tv.slashdot.org/
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/edk2-devel


------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel