RE: [PATCH mmc-utils] fix GCC7 build by refactoring trimming routines

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

 



Hi,

> 
> I got a compile error with GCC7. When trimming white spaces from strings
> lsmmc uses strncpy with overlapping memory areas. This is not allowed.
> In addition, the implementation was not efficient with calling strlen
> and strncpy once per iteration. Refactor the code to be valid and more
> effective.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx>
> ---
>  lsmmc.c | 16 +++++++++++-----
>  1 file changed, 11 insertions(+), 5 deletions(-)
> 
> diff --git a/lsmmc.c b/lsmmc.c
> index c4faa00..9737b37 100644
> --- a/lsmmc.c
> +++ b/lsmmc.c
> @@ -316,8 +316,9 @@ int parse_ids(struct config *config)
>  /* MMC/SD file parsing functions */
>  char *read_file(char *name)
>  {

See Uwe's note - https://www.spinics.net/lists/linux-mmc/msg51882.html

Cheers,
Avri




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux