mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-02 01:18:26 +03:00
Fix uuid_from_num() buffer overrun.
This commit is contained in:
parent
7dc850db3e
commit
eba586f053
@ -1,5 +1,6 @@
|
|||||||
Version 2.02.06 -
|
Version 2.02.06 -
|
||||||
=================================
|
=================================
|
||||||
|
Fix uuid_from_num() buffer overrun.
|
||||||
Make SIZE_SHORT the default for display_size().
|
Make SIZE_SHORT the default for display_size().
|
||||||
Fix some memory leaks in error paths found by coverity.
|
Fix some memory leaks in error paths found by coverity.
|
||||||
Use C99 struct initialisers.
|
Use C99 struct initialisers.
|
||||||
|
@ -153,8 +153,10 @@ static int _munge_formats(struct pv_disk *pvd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* If UUID is missing, create one */
|
/* If UUID is missing, create one */
|
||||||
if (pvd->pv_uuid[0] == '\0')
|
if (pvd->pv_uuid[0] == '\0') {
|
||||||
uuid_from_num((char *)pvd->pv_uuid, pvd->pv_number);
|
uuid_from_num((char *)pvd->pv_uuid, pvd->pv_number);
|
||||||
|
pvd->pv_uuid[ID_LEN] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ const char *text_vgname_import(const struct format_type *fmt,
|
|||||||
{
|
{
|
||||||
struct config_tree *cft;
|
struct config_tree *cft;
|
||||||
struct text_vg_version_ops **vsn;
|
struct text_vg_version_ops **vsn;
|
||||||
const char *vgname;
|
const char *vgname = NULL;
|
||||||
|
|
||||||
static int _text_import_initialised = 0;
|
static int _text_import_initialised = 0;
|
||||||
|
|
||||||
|
@ -40,8 +40,6 @@ void uuid_from_num(char *uuid, uint32_t num)
|
|||||||
uuid[i - 1] = _c[num % (sizeof(_c) - 1)];
|
uuid[i - 1] = _c[num % (sizeof(_c) - 1)];
|
||||||
num /= sizeof(_c) - 1;
|
num /= sizeof(_c) - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
uuid[ID_LEN] = '\0';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int lvid_from_lvnum(union lvid *lvid, struct id *vgid, uint32_t lv_num)
|
int lvid_from_lvnum(union lvid *lvid, struct id *vgid, uint32_t lv_num)
|
||||||
|
Loading…
Reference in New Issue
Block a user