Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/libltfs/tape.c
Original file line number Diff line number Diff line change
Expand Up @@ -1769,6 +1769,10 @@ int tape_set_cart_coherency(struct device_data *dev, const tape_partition_t part
int ret;
unsigned char coh_data[TC_MAM_PAGE_COHERENCY_SIZE + TC_MAM_PAGE_HEADER_SIZE];

/* Zero the buffer so the "LTFS\0" signature's NUL terminator is written: the
* arch_strncpy below only copies 4 bytes, and the reader checks all 5. */
memset(coh_data, 0, sizeof(coh_data));

CHECK_ARG_NULL(dev, -LTFS_NULL_ARG);
CHECK_ARG_NULL(dev->backend, -LTFS_NULL_ARG);

Expand Down