![]() | |||||||||||
Messages in this thread Patch in this message |
Add sanity check to dm_table_add_target() against zero length targets. [Christophe Saout]
--- diff/drivers/md/dm-table.c 2004-02-10 16:11:58.000000000 +0000
+++ source/drivers/md/dm-table.c 2004-02-10 16:12:04.000000000 +0000
@@ -655,6 +655,11 @@
memset(tgt, 0, sizeof(*tgt));
set_default_limits(&tgt->limits);
+ if (!len) {
+ tgt->error = "zero-length target";
+ return -EINVAL;
+ }
+
tgt->type = dm_get_target_type(type);
if (!tgt->type) {
tgt->error = "unknown target type";
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
| ||||||||||
| Last update: 2005-03-22 14:00 [from the cache] ©2003-2008 | |||||||||||