Hi,

I was looking parted-1.6.22's code and I found out that init_ide() is using hdi.model instead of hdi_buf to initialize the device's model. As the comment in the code says, hdi.model might not be NULL terminated, so hdi_buf should be used, right?

Regards,

-- Ulisses
--- parted-1.6.22/libparted/linux.c.orig        2005-05-01 17:47:04.000000000 
+0000
+++ parted-1.6.22/libparted/linux.c     2005-05-01 17:48:45.000000000 +0000
@@ -519,7 +519,7 @@
                /* hdi.model is not guaranteed to be NULL terminated */
                memcpy (hdi_buf, hdi.model, 40);
                hdi_buf[40] = '\0';
-               dev->model = strip_name (hdi.model);
+               dev->model = strip_name (hdi_buf);
        }
 
        if (!_device_probe_geometry (dev))
_______________________________________________
Bug-parted mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-parted

Reply via email to