[locale] Corrected return value check.
Checks
Context |
Check |
Description |
dj/TryBot-apply_patch |
success
|
Patch applied to master at the time it was sent
|
dj/TryBot-32bit |
success
|
Build for i686
|
Commit Message
strtol returns LONG_MAX or LONG_MIN on
ERANGE error.
This issue was found by SVACE static analyzer.
---
locale/programs/ld-collate.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
@@ -1344,12 +1344,12 @@ order for `%.*s' already defined at %s:%Zu"),
errno = 0;
from = strtol (startp->name + preflen, &cp, base);
- if ((from == UINT_MAX && errno == ERANGE) || *cp != '\0')
+ if (((from == LONG_MAX || from == LONG_MIN ) && errno == ERANGE) || *cp != '\0')
goto invalid_range;
errno = 0;
to = strtol (endp->name + preflen, &cp, base);
- if ((to == UINT_MAX && errno == ERANGE) || *cp != '\0')
+ if (((to == LONG_MAX || to == LONG_MIN ) && errno == ERANGE) || *cp != '\0')
goto invalid_range;
/* Copy the prefix. */