[PATCH] 1/5: dm-ioctl.c: fix off-by-one error

From: Kevin Corry
Date: Wed May 26 2004 - 12:03:01 EST


dm-ioctl.c: Fix an OB1 error when calculating an output buffer size,
that could cause a missing null termininator in the 'list devices'
ioctl results. [Steffan Paletta]

--- diff/drivers/md/dm-ioctl.c 2004-05-09 21:32:26.000000000 -0500
+++ source/drivers/md/dm-ioctl.c 2004-05-25 10:13:20.000000000 -0500
@@ -377,7 +377,7 @@
for (i = 0; i < NUM_BUCKETS; i++) {
list_for_each_entry (hc, _name_buckets + i, name_list) {
needed += sizeof(struct dm_name_list);
- needed += strlen(hc->name);
+ needed += strlen(hc->name) + 1;
needed += ALIGN_MASK;
}
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/