Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F152510158
D53069.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
575 B
Referenced Files
None
Subscribers
None
D53069.id.diff
View Options
diff --git a/sys/contrib/libnv/bsd_nvpair.c b/sys/contrib/libnv/bsd_nvpair.c
--- a/sys/contrib/libnv/bsd_nvpair.c
+++ b/sys/contrib/libnv/bsd_nvpair.c
@@ -985,13 +985,13 @@
size = nvp->nvp_datasize;
tmp = (const char *)ptr;
for (ii = 0; ii < nvp->nvp_nitems; ii++) {
- len = strnlen(tmp, size - 1) + 1;
- size -= len;
- if (tmp[len - 1] != '\0') {
+ if (size <= 0) {
ERRNO_SET(EINVAL);
return (NULL);
}
- if (size < 0) {
+ len = strnlen(tmp, size - 1) + 1;
+ size -= len;
+ if (tmp[len - 1] != '\0') {
ERRNO_SET(EINVAL);
return (NULL);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 16, 10:17 AM (19 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31568150
Default Alt Text
D53069.id.diff (575 B)
Attached To
Mode
D53069: libnv: Fix a length check in nvpair_unpack_string_array()
Attached
Detach File
Event Timeline
Log In to Comment