The branch main has been updated by kib:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=9940ac808de7b7d4ed0408c3e739f667dca06d3b

commit 9940ac808de7b7d4ed0408c3e739f667dca06d3b
Author:     Konstantin Belousov <[email protected]>
AuthorDate: 2021-01-23 10:45:51 +0000
Commit:     Konstantin Belousov <[email protected]>
CommitDate: 2021-01-23 15:24:32 +0000

    elfctl: Fix type errors.
    
    Target value for val has uint32_t type, not uint, adjust used constant.
    Change val type to unsigned so that left and right sides of comparision
    operator do not expose different signed types of same range [*].
    
    Switch to unsigned long long and strtoll(3) so that 0x80000000 is
    accepted by conversion function [**].
    
    Reported by:    kargl [*]
    Noted by:       emaste [**]
    Reviewed by:    emaste
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D28301
---
 usr.bin/elfctl/elfctl.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/usr.bin/elfctl/elfctl.c b/usr.bin/elfctl/elfctl.c
index 300a66eb516e..bcdd1be394a9 100644
--- a/usr.bin/elfctl/elfctl.c
+++ b/usr.bin/elfctl/elfctl.c
@@ -41,6 +41,7 @@
 #include <getopt.h>
 #include <libelf.h>
 #include <stdbool.h>
+#include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -249,13 +250,13 @@ convert_to_feature_val(char *feature_str, uint32_t 
*feature_val)
                if (i == len) {
                        if (isdigit(feature[0])) {
                                char *eptr;
-                               long val;
+                               unsigned long long val;
 
                                errno = 0;
-                               val = strtol(feature, &eptr, 0);
+                               val = strtoll(feature, &eptr, 0);
                                if (eptr == feature || *eptr != '\0')
                                        errno = EINVAL;
-                               else if (val > UINT_MAX)
+                               else if (val > UINT32_MAX)
                                        errno = ERANGE;
                                if (errno != 0) {
                                        warn("%s invalid", feature);
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main
To unsubscribe, send any mail to "[email protected]"

Reply via email to