diff mbox series

elf: Parse the auxv values as unsigned on tst-tunables-enable_secure-env.c (BZ 31890)

Message ID 20240718121607.3609710-1-adhemerval.zanella@linaro.org
State New
Headers show
Series elf: Parse the auxv values as unsigned on tst-tunables-enable_secure-env.c (BZ 31890) | expand

Commit Message

Adhemerval Zanella Netto July 18, 2024, 12:15 p.m. UTC
AT_HWCAP on some architecture can indeed use all bits.

Checked on x86_64-linux-gnu and powerpc-linux-gnu.
---
 elf/tst-tunables-enable_secure-env.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andreas K. Huettel July 18, 2024, 12:35 p.m. UTC | #1
Bug number is wrong, it's 31980

Am Donnerstag, 18. Juli 2024, 14:15:44 CEST schrieb Adhemerval Zanella:
> AT_HWCAP on some architecture can indeed use all bits.
> 
> Checked on x86_64-linux-gnu and powerpc-linux-gnu.
> ---
>  elf/tst-tunables-enable_secure-env.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/elf/tst-tunables-enable_secure-env.c b/elf/tst-tunables-enable_secure-env.c
> index 01f121efc3..937259f218 100644
> --- a/elf/tst-tunables-enable_secure-env.c
> +++ b/elf/tst-tunables-enable_secure-env.c
> @@ -46,7 +46,7 @@ check_auxv (unsigned long type, char *argv)
>  {
>    char *endptr;
>    errno = 0;
> -  unsigned long int varg = strtol (argv, &endptr, 10);
> +  unsigned long int varg = strtoul (argv, &endptr, 10);

OK for 2.40 with the fixed bug number

Reviewed-By: Andreas K. Hüttel <dilfridge@gentoo.org>

>    TEST_VERIFY_EXIT (errno == 0);
>    TEST_VERIFY_EXIT (*endptr == '\0');
>    errno = 0;
>
Adhemerval Zanella Netto July 19, 2024, 1:23 p.m. UTC | #2
On 18/07/24 09:35, Andreas K. Huettel wrote:
> Bug number is wrong, it's 31980

Sigh, and I pushed the wrong number anyway... sorry about that.

> 
> Am Donnerstag, 18. Juli 2024, 14:15:44 CEST schrieb Adhemerval Zanella:
>> AT_HWCAP on some architecture can indeed use all bits.
>>
>> Checked on x86_64-linux-gnu and powerpc-linux-gnu.
>> ---
>>  elf/tst-tunables-enable_secure-env.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/elf/tst-tunables-enable_secure-env.c b/elf/tst-tunables-enable_secure-env.c
>> index 01f121efc3..937259f218 100644
>> --- a/elf/tst-tunables-enable_secure-env.c
>> +++ b/elf/tst-tunables-enable_secure-env.c
>> @@ -46,7 +46,7 @@ check_auxv (unsigned long type, char *argv)
>>  {
>>    char *endptr;
>>    errno = 0;
>> -  unsigned long int varg = strtol (argv, &endptr, 10);
>> +  unsigned long int varg = strtoul (argv, &endptr, 10);
> 
> OK for 2.40 with the fixed bug number
> 
> Reviewed-By: Andreas K. Hüttel <dilfridge@gentoo.org>
> 
>>    TEST_VERIFY_EXIT (errno == 0);
>>    TEST_VERIFY_EXIT (*endptr == '\0');
>>    errno = 0;
>>
> 
>
diff mbox series

Patch

diff --git a/elf/tst-tunables-enable_secure-env.c b/elf/tst-tunables-enable_secure-env.c
index 01f121efc3..937259f218 100644
--- a/elf/tst-tunables-enable_secure-env.c
+++ b/elf/tst-tunables-enable_secure-env.c
@@ -46,7 +46,7 @@  check_auxv (unsigned long type, char *argv)
 {
   char *endptr;
   errno = 0;
-  unsigned long int varg = strtol (argv, &endptr, 10);
+  unsigned long int varg = strtoul (argv, &endptr, 10);
   TEST_VERIFY_EXIT (errno == 0);
   TEST_VERIFY_EXIT (*endptr == '\0');
   errno = 0;