[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/4] Add virtio disk identification support
From: |
john cooper |
Subject: |
[Qemu-devel] [PATCH 2/4] Add virtio disk identification support |
Date: |
Thu, 25 Mar 2010 01:33:02 -0400 |
User-agent: |
Thunderbird 2.0.0.9 (X11/20071115) |
Fix bug which truncated serial string to 8 bytes, nul terminate.
Signed-off-by: john cooper <address@hidden>
---
diff --git a/vl.c b/vl.c
index d69250c..b74cbba 100644
--- a/vl.c
+++ b/vl.c
@@ -1162,7 +1162,7 @@ DriveInfo *drive_init(QemuOpts *opts, void *opaque,
dinfo->on_write_error = on_write_error;
dinfo->opts = opts;
if (serial)
- strncpy(dinfo->serial, serial, sizeof(serial));
+ strncpy(dinfo->serial, serial, sizeof(dinfo->serial) - 1);
QTAILQ_INSERT_TAIL(&drives, dinfo, next);
switch(type) {
--
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-devel] [PATCH 2/4] Add virtio disk identification support,
john cooper <=