summaryrefslogtreecommitdiff
path: root/libexec/ld.so
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2017-08-16 18:52:02 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2017-08-16 18:52:02 +0000
commit9ff8a5ea778a0787111e7796219513fd442a1e7d (patch)
tree41e5f3306ca987240fad6571ffc3d59b132dc2ec /libexec/ld.so
parentf298e76ee8f614e00a67873bf4b8b2029f7a721b (diff)
Adapt the commit in libc that changes how a string like "0xy" is
parsed. OK deraadt@
Diffstat (limited to 'libexec/ld.so')
-rw-r--r--libexec/ld.so/strtol.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libexec/ld.so/strtol.c b/libexec/ld.so/strtol.c
index 7116e557cb3..676c2db6421 100644
--- a/libexec/ld.so/strtol.c
+++ b/libexec/ld.so/strtol.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strtol.c,v 1.2 2015/01/16 16:18:07 deraadt Exp $ */
+/* $OpenBSD: strtol.c,v 1.3 2017/08/16 18:52:01 millert Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -64,8 +64,9 @@ _dl_strtol(const char *nptr, char **endptr, int base)
if (c == '+')
c = *s++;
}
- if ((base == 0 || base == 16) &&
- c == '0' && (*s == 'x' || *s == 'X')) {
+ if ((base == 0 || base == 16) && c == '0' &&
+ (*s == 'x' || *s == 'X') && ((s[1] >= '0' && s[1] <= '9') ||
+ (s[1] >= 'A' && s[1] <= 'F') || (s[1] >= 'a' && s[1] <= 'f'))) {
c = s[1];
s += 2;
base = 16;