Whamcloud - gitweb
Branch HEAD
authorbobijam <bobijam>
Mon, 4 Aug 2008 02:03:16 +0000 (02:03 +0000)
committerbobijam <bobijam>
Mon, 4 Aug 2008 02:03:16 +0000 (02:03 +0000)
b=15576
i=adilger, johann

minor fix to make the code safer.

lustre/obdclass/genops.c

index d015eff..98c15fe 100644 (file)
@@ -317,7 +317,7 @@ struct obd_device *class_newdev(const char *type_name, const char *name)
                         new_obd_minor = i;
                         result->obd_type = type;
                         strncpy(result->obd_name, name,
-                                sizeof(result->obd_name));
+                                sizeof(result->obd_name) - 1);
                         obd_devs[i] = result;
                 }
         }