Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F163926955
D21152.id60432.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D21152.id60432.diff
View Options
Index: lib/libc/gen/auxv.3
===================================================================
--- lib/libc/gen/auxv.3
+++ lib/libc/gen/auxv.3
@@ -82,5 +82,3 @@
.Sh BUGS
Only a small subset of available auxiliary info vector items are
accessible with this function.
-Some items require a "right-sized" buffer while others just require a
-"big enough" buffer.
Index: lib/libc/gen/auxv.c
===================================================================
--- lib/libc/gen/auxv.c
+++ lib/libc/gen/auxv.c
@@ -140,8 +140,8 @@
switch (aux) {
case AT_CANARY:
- if (canary != NULL && canary_len >= buflen) {
- memcpy(buf, canary, buflen);
+ if (canary != NULL && buflen >= canary_len) {
+ memcpy(buf, canary, canary_len);
memset(canary, 0, canary_len);
canary = NULL;
res = 0;
@@ -149,21 +149,21 @@
res = ENOENT;
break;
case AT_HWCAP:
- if (hwcap_present && buflen == sizeof(u_long)) {
+ if (hwcap_present && buflen >= sizeof(u_long)) {
*(u_long *)buf = hwcap;
res = 0;
} else
res = ENOENT;
break;
case AT_HWCAP2:
- if (hwcap2_present && buflen == sizeof(u_long)) {
+ if (hwcap2_present && buflen >= sizeof(u_long)) {
*(u_long *)buf = hwcap2;
res = 0;
} else
res = ENOENT;
break;
case AT_NCPUS:
- if (buflen == sizeof(int)) {
+ if (buflen >= sizeof(int)) {
if (ncpus != 0) {
*(int *)buf = ncpus;
res = 0;
@@ -173,14 +173,14 @@
res = EINVAL;
break;
case AT_PAGESIZES:
- if (pagesizes != NULL && pagesizes_len >= buflen) {
- memcpy(buf, pagesizes, buflen);
+ if (pagesizes != NULL && buflen >= pagesizes_len) {
+ memcpy(buf, pagesizes, pagesizes_len);
res = 0;
} else
res = ENOENT;
break;
case AT_PAGESZ:
- if (buflen == sizeof(int)) {
+ if (buflen >= sizeof(int)) {
if (pagesize != 0) {
*(int *)buf = pagesize;
res = 0;
@@ -190,7 +190,7 @@
res = EINVAL;
break;
case AT_OSRELDATE:
- if (buflen == sizeof(int)) {
+ if (buflen >= sizeof(int)) {
if (osreldate != 0) {
*(int *)buf = osreldate;
res = 0;
@@ -200,7 +200,7 @@
res = EINVAL;
break;
case AT_TIMEKEEP:
- if (buflen == sizeof(void *)) {
+ if (buflen >= sizeof(void *)) {
if (timekeep != NULL) {
*(void **)buf = timekeep;
res = 0;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Jul 28, 5:54 AM (1 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35636358
Default Alt Text
D21152.id60432.diff (2 KB)
Attached To
Mode
D21152: elf_aux_info(3): accept a "big enough" buffer
Attached
Detach File
Event Timeline
Log In to Comment