Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F149519968
D41510.1790336285.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D41510.1790336285.diff
View Options
diff --git a/lib/libc/iconv/_strtol.h b/lib/libc/iconv/_strtol.h
--- a/lib/libc/iconv/_strtol.h
+++ b/lib/libc/iconv/_strtol.h
@@ -83,7 +83,10 @@
c = *s++;
}
if ((base == 0 || base == 16) &&
- c == '0' && (*s == 'x' || *s == 'X')) {
+ 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;
diff --git a/lib/libc/iconv/_strtoul.h b/lib/libc/iconv/_strtoul.h
--- a/lib/libc/iconv/_strtoul.h
+++ b/lib/libc/iconv/_strtoul.h
@@ -79,7 +79,10 @@
c = *s++;
}
if ((base == 0 || base == 16) &&
- c == '0' && (*s == 'x' || *s == 'X')) {
+ 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;
diff --git a/lib/libc/locale/wcstoimax.c b/lib/libc/locale/wcstoimax.c
--- a/lib/libc/locale/wcstoimax.c
+++ b/lib/libc/locale/wcstoimax.c
@@ -78,7 +78,10 @@
c = *s++;
}
if ((base == 0 || base == 16) &&
- c == L'0' && (*s == L'x' || *s == L'X')) {
+ c == '0' && (*s == 'x' || *s == 'X') &&
+ ((s[1] >= L'0' && s[1] <= L'9') ||
+ (s[1] >= L'A' && s[1] <= L'F') ||
+ (s[1] >= L'a' && s[1] <= L'f'))) {
c = s[1];
s += 2;
base = 16;
diff --git a/lib/libc/locale/wcstol.c b/lib/libc/locale/wcstol.c
--- a/lib/libc/locale/wcstol.c
+++ b/lib/libc/locale/wcstol.c
@@ -72,7 +72,10 @@
c = *s++;
}
if ((base == 0 || base == 16) &&
- c == L'0' && (*s == L'x' || *s == L'X')) {
+ c == '0' && (*s == 'x' || *s == 'X') &&
+ ((s[1] >= L'0' && s[1] <= L'9') ||
+ (s[1] >= L'A' && s[1] <= L'F') ||
+ (s[1] >= L'a' && s[1] <= L'f'))) {
c = s[1];
s += 2;
base = 16;
diff --git a/lib/libc/locale/wcstoll.c b/lib/libc/locale/wcstoll.c
--- a/lib/libc/locale/wcstoll.c
+++ b/lib/libc/locale/wcstoll.c
@@ -78,7 +78,10 @@
c = *s++;
}
if ((base == 0 || base == 16) &&
- c == L'0' && (*s == L'x' || *s == L'X')) {
+ c == '0' && (*s == 'x' || *s == 'X') &&
+ ((s[1] >= L'0' && s[1] <= L'9') ||
+ (s[1] >= L'A' && s[1] <= L'F') ||
+ (s[1] >= L'a' && s[1] <= L'f'))) {
c = s[1];
s += 2;
base = 16;
diff --git a/lib/libc/locale/wcstoul.c b/lib/libc/locale/wcstoul.c
--- a/lib/libc/locale/wcstoul.c
+++ b/lib/libc/locale/wcstoul.c
@@ -72,7 +72,10 @@
c = *s++;
}
if ((base == 0 || base == 16) &&
- c == L'0' && (*s == L'x' || *s == L'X')) {
+ c == '0' && (*s == 'x' || *s == 'X') &&
+ ((s[1] >= L'0' && s[1] <= L'9') ||
+ (s[1] >= L'A' && s[1] <= L'F') ||
+ (s[1] >= L'a' && s[1] <= L'f'))) {
c = s[1];
s += 2;
base = 16;
diff --git a/lib/libc/locale/wcstoull.c b/lib/libc/locale/wcstoull.c
--- a/lib/libc/locale/wcstoull.c
+++ b/lib/libc/locale/wcstoull.c
@@ -78,7 +78,10 @@
c = *s++;
}
if ((base == 0 || base == 16) &&
- c == L'0' && (*s == L'x' || *s == L'X')) {
+ c == '0' && (*s == 'x' || *s == 'X') &&
+ ((s[1] >= L'0' && s[1] <= L'9') ||
+ (s[1] >= L'A' && s[1] <= L'F') ||
+ (s[1] >= L'a' && s[1] <= L'f'))) {
c = s[1];
s += 2;
base = 16;
diff --git a/lib/libc/locale/wcstoumax.c b/lib/libc/locale/wcstoumax.c
--- a/lib/libc/locale/wcstoumax.c
+++ b/lib/libc/locale/wcstoumax.c
@@ -78,7 +78,10 @@
c = *s++;
}
if ((base == 0 || base == 16) &&
- c == L'0' && (*s == L'x' || *s == L'X')) {
+ c == '0' && (*s == 'x' || *s == 'X') &&
+ ((s[1] >= L'0' && s[1] <= L'9') ||
+ (s[1] >= L'A' && s[1] <= L'F') ||
+ (s[1] >= L'a' && s[1] <= L'f'))) {
c = s[1];
s += 2;
base = 16;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Sep 25, 11:38 AM (14 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29920494
Default Alt Text
D41510.1790336285.diff (3 KB)
Attached To
Mode
D41510: libc: Fix parsing of hexadecimal numbers in strtol() family.
Attached
Detach File
Event Timeline
Log In to Comment