| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
If alloca allocates too much stack space, program behavior is undefined,
and basically we segfault. There is no way to check whether this will
happen ahead of time, so our only choice is to switch to malloc. If we
try to allocate too much memory from the heap, we'll get a NULL pointer,
and we can diagnose & exit ourselves. Kind of sucks as alloca was a
perfect fit here, but since the size is coming directly from user input,
we can't trust it is always "reasonable".
Bug: https://bugs.gentoo.org/890579
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
|
|
| |
Check the extended filename offset doesn't exceed the size of the
extended filename section.
Bug: https://bugs.gentoo.org/890579
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The atoi helper handles signed 32-bit integers, and expects the input
strings to be NUL terminated. Some of the fields are larger than what
signed 32-bit can handle, and none of them are NUL terminated. The
code currently works because it stops processing once it reaches text
that is not numeric, and the content that follows each field is always
non-numeric (e.g. a space).
Add a helper function that leverages strtoll as all of the fields can
fit into a signed 64-bit number. If the number is invalid, flag it as
such, and normalize it to 0 so the rest of the code can continue on.
Bug: https://bugs.gentoo.org/890577
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
|
| |
The scanelf --help output is the best & most flexible, so move that
to common code so the rest of the tools can benefit from it.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
| |
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 781a3856ae53df051563645b45d8ff7033aea113.
The header is already included in porting.h. We want to keep all
system headers centralized in porting.h and not sprinkle across
the other modules.
Signed-off-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
I wasn't paying enough attention, it's better to just fold the needed
bits into porting.h.
This reverts commit ffedc60fa41d307bda28fd108e6ff1b8da1fc2ee.
This reverts commit f8287200aec0ca33ef07fafcdd5aef0aa6eb1306.
This reverts commit aa907a42d89ddfd5a7e64d8182a1da35277f2f6e.
Bug: https://github.com/gentoo/pax-utils/pull/11#issuecomment-1407566344
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
| |
Separate from the first commit as this one was done programmatically with
dev-util/include-what-you-use.
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
| |
This way we can use the funcs in other modules. It makes scanelf
a little bigger (~1k), but shouldn't be a big deal overall.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
It's not uncommon for embedded toolchains or random targets to create
their own spin on the archive format. Rather than complain about all
of these by default, put it behind the -v flag. It's not like people
can do anything about this normally anyways.
URL: https://bugs.gentoo.org/428464
|
|
|
|
|
|
| |
When scanelf runs on a directory tree, it might issue an error message
about invalid data because of one of the files in there. Trying to then
track down that file is kind of a pain, so make things more explicit.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The Darwin linker creates BSD ar archives, which (stupidly) always use
the "extended filename" method to store filenames. For this reason I
implemented the BSD extended filename method in paxinc's ar_next.
Next to some fixes in the macho code not to free and unmap when this is
not desired, this yields in a working scanmacho on static archives.
The change has been checked with scanelf against a GNU ELF static
archive not to break anything.
|
|
|
|
| |
and add some more comments
|
| |
|
| |
|
|
|
|
| |
<ludwig.nussel@suse.de> Ref: https://bugzilla.novell.com/show_bug.cgi?id=239172
|
| |
|
| |
|
| |
|
|
|