mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
libelf: rationalize error handling in ELF note conversion
Previously _libelf_cvt_NOTE_tom (to host) returned false if a note's namesz + descsz exceeded the buffer size, while _libelf_cvt_NOTE_tof (to file) silently truncated. Return false in the latter case too. Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
d8c51c6f74
commit
2f7242ed33
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=358685
|
@ -1022,7 +1022,7 @@ _libelf_cvt_NOTE_tof(unsigned char *dst, size_t dsz, unsigned char *src,
|
|||
count -= sizeof(Elf_Note);
|
||||
|
||||
if (count < sz)
|
||||
sz = count;
|
||||
return (0);
|
||||
|
||||
(void) memcpy(dst, src, sz);
|
||||
|
||||
|
|
Loading…
Reference in a new issue