Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F139329530
D51433.id158813.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D51433.id158813.diff
View Options
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -284,19 +284,32 @@
return (0);
}
- /*
- * If there's no end pointer then the buffer is coming from
- * the kenv and we know it's null-terminated.
- */
- if (end == NULL)
+ /* Ensure that strtoq() won't walk off the end */
+ if (end == NULL) {
+ /*
+ * If there's no end pointer then the buffer is coming from
+ * the kenv and we know it's null-terminated.
+ */
end = *list + strlen(*list);
+ } else {
+ /*
+ * If there is and end pointer then the buffer is not null-
+ * terminated. The pointer is after the end of the buffer, so
+ * we need to change the last char inside the buffer to \0 if
+ * we can.
+ */
+ end--;
- /* Ensure that strtoq() won't walk off the end */
- if (*end != '\0') {
- if (*end == '\n' || *end == ' ' || *end == ',')
+ switch (*end) {
+ case '\n':
+ case ' ':
+ case ',':
*end = '\0';
- else {
- printf("Blacklist not terminated, skipping\n");
+ /* FALLTHROUGH */
+ case '\0':
+ break;
+ default:
+ printf("Blacklist not terminated by '\\n', ' ' or ',', skipping\n");
*list = NULL;
return (0);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 11, 10:04 PM (14 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26877583
Default Alt Text
D51433.id158813.diff (1 KB)
Attached To
Mode
D51433: Fix loading bad memory addresses from file
Attached
Detach File
Event Timeline
Log In to Comment