mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Remove VLAs from UUID block parsing code.
This commit is contained in:
@@ -406,10 +406,10 @@ int lookup_by_disk_id(const char *dm_uuid)
|
||||
return r;
|
||||
}
|
||||
|
||||
int lookup_by_sysfs_uuid_field(const char *dm_uuid, size_t max_len)
|
||||
int lookup_by_sysfs_uuid_field(const char *dm_uuid)
|
||||
{
|
||||
struct dirent *entry;
|
||||
char subpath[PATH_MAX], uuid[max_len];
|
||||
char subpath[PATH_MAX], uuid[DM_UUID_LEN];
|
||||
ssize_t s;
|
||||
struct stat st;
|
||||
int fd, len, r = 0; /* not found */
|
||||
@@ -441,7 +441,7 @@ int lookup_by_sysfs_uuid_field(const char *dm_uuid, size_t max_len)
|
||||
}
|
||||
|
||||
/* reads binary data */
|
||||
s = read_buffer(fd, uuid, max_len - 1);
|
||||
s = read_buffer(fd, uuid, sizeof(uuid) - 1);
|
||||
if (s > 0) {
|
||||
uuid[s] = '\0';
|
||||
if (!strncmp(uuid, dm_uuid, strlen(dm_uuid)))
|
||||
|
||||
Reference in New Issue
Block a user