diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-11-22 01:15:25 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-11-22 01:15:25 +0100 |
commit | 7ac6140af72307e147cb31e4d14d2a5a35887e29 (patch) | |
tree | 93e91b88ca64c068c6ed8549ba5b34eaa8674166 /acpi | |
parent | 002d3b6beb17d917cda26be2ec2a7e3d51e58a60 (diff) | |
download | hurd-7ac6140af72307e147cb31e4d14d2a5a35887e29.tar.gz hurd-7ac6140af72307e147cb31e4d14d2a5a35887e29.tar.bz2 hurd-7ac6140af72307e147cb31e4d14d2a5a35887e29.zip |
acpi: Fix table name truncation
* acpi/acpifs.c (create_dir_entry): Fix terminating entry->name string.
diff --git a/eth-multiplexer/vdev.c b/eth-multiplexer/vdev.c
index 367623d9..c76cfbfd 100644
--- a/eth-multiplexer/vdev.c
+++ b/eth-multiplexer/vdev.c
@@ -139,7 +139,8 @@ add_vdev (char *name, size_t size)
vdev->dev_port = ports_get_right (vdev);
ports_port_deref (vdev);
- strncpy (vdev->name, name, IFNAMSIZ);
+ strncpy (vdev->name, name, IFNAMSIZ-1);
+ vdev->name[IFNAMSIZ-1] = '\0';
vdev->if_header_size = ETH_HLEN;
vdev->if_mtu = ETH_MTU;
vdev->if_header_format = HDR_ETHERNET;
Diffstat (limited to 'acpi')
-rw-r--r-- | acpi/acpifs.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/acpi/acpifs.c b/acpi/acpifs.c index e779e0f9..2b5fbc00 100644 --- a/acpi/acpifs.c +++ b/acpi/acpifs.c @@ -39,7 +39,8 @@ create_dir_entry (char *name, struct acpi_table *t, { uint16_t parent_num_entries; - strncpy (entry->name, name, NAME_SIZE); + strncpy (entry->name, name, NAME_SIZE-1); + entry->name[NAME_SIZE-1] = '\0'; entry->acpitable = t; entry->parent = parent; entry->stat = stat; |