1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

lvmcache: copy just 32bytes

Copy only bytes which fits.

vginfo->vgid  is  [ID_LEN + 1]
vgsummary->vgid has only [ID_LEN]

Reported by Coverity.
This commit is contained in:
Zdenek Kabelac 2015-05-07 11:28:22 +02:00
parent 87578b5d94
commit bf5cb4af8e
2 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.120 - Version 2.02.120 -
=============================== ===============================
Fix storing of vgid when caching metadata (2.02.118).
Fix recursive lvm-config man page. (2.02.119) Fix recursive lvm-config man page. (2.02.119)
Refactor polldaemon interfaces to poll every operation by VG/LV couple Refactor polldaemon interfaces to poll every operation by VG/LV couple
Skip wait after testing in _wait_for_single_lv when polling finished Skip wait after testing in _wait_for_single_lv when polling finished

View File

@ -2233,7 +2233,8 @@ int lvmcache_lookup_mda(struct lvmcache_vgsummary *vgsummary)
vgsummary->vgname = vginfo->vgname; vgsummary->vgname = vginfo->vgname;
vgsummary->creation_host = vginfo->creation_host; vgsummary->creation_host = vginfo->creation_host;
vgsummary->vgstatus = vginfo->status; vgsummary->vgstatus = vginfo->status;
memcpy((char *)&vgsummary->vgid, vginfo->vgid, sizeof(vginfo->vgid)); /* vginfo->vgid has 1 extra byte then vgsummary->vgid */
memcpy(&vgsummary->vgid, vginfo->vgid, sizeof(vgsummary->vgid));
return 1; return 1;
} }