This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v6 12/16] RISC-V: Linux ABI


On Thu, 25 Jan 2018, Palmer Dabbelt wrote:

> +      if (len >= 4 && ! memcmp(path + len - 4, "/lib", 4))		\
> +	{								\
> +	  memcpy (path + len, "64/lp64d", 10);				\
> +	  add_dir (path);						\
> +	  memcpy (path + len, "64/lp64", 9);				\
> +	  add_dir (path);						\

Off-by-one errors in the amount copied, "64/lp64d" is 9 bytes including 
trailing NUL and "64/lp64" is 8 bytes.  (In turn this means path actually 
only needs dimension [len + 9].

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]