libelf: Make sure ar_size starts with a digit before calling atol.
authorMark Wielaard <mark@klomp.org>
Thu, 17 Mar 2022 13:03:06 +0000 (14:03 +0100)
committerMark Wielaard <mark@klomp.org>
Thu, 17 Mar 2022 23:54:55 +0000 (00:54 +0100)
commited42e7cf11ddb11ffcce9e17276476e0c3d14c71
tree1ed73124e8513b6afac3457b0a5ad7e5165e229b
parent1b09e67353f46f2ff9039da78a37d7717155df08
libelf: Make sure ar_size starts with a digit before calling atol.

The ar_size field is a 10 character string, not zero terminated, of
decimal digits right padded with spaces.  Make sure it actually starts
with a digit before calling atol on it.  We already make sure it is
zero terminated. Otherwise atol might produce unexpected results.

Signed-off-by: Mark Wielaard <mark@klomp.org>
libelf/ChangeLog
libelf/elf_begin.c