summaryrefslogtreecommitdiff
path: root/src/udev/udev-ctrl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/udev/udev-ctrl.c')
-rw-r--r--src/udev/udev-ctrl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/udev/udev-ctrl.c b/src/udev/udev-ctrl.c
index efe7297f04..5382ce0d26 100644
--- a/src/udev/udev-ctrl.c
+++ b/src/udev/udev-ctrl.c
@@ -239,7 +239,10 @@ static int ctrl_send(struct udev_ctrl *uctrl, enum udev_ctrl_msg_type type, int
int err = 0;
memzero(&ctrl_msg_wire, sizeof(struct udev_ctrl_msg_wire));
- strcpy(ctrl_msg_wire.version, "udev-" PACKAGE_VERSION);
+ /* jsynacek: As PACKAGE_VERSION is populated from the spec file with %{version}-%{release},
+ * it might not fit entirely into the version field. */
+ strncpy(ctrl_msg_wire.version, "udev-" PACKAGE_VERSION, 16-5);
+ ctrl_msg_wire.version[15] = '\0';
ctrl_msg_wire.magic = UDEV_CTRL_MAGIC;
ctrl_msg_wire.type = type;