Skip to contentSkip to conversation

master - cov: index off by one

PATCH Zdenek Kabelac 1 participant 1 message Oct 15, 2018

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=77aa055e8a34eb7f0036b6240f3f93dc429c0c02
Commit:        77aa055e8a34eb7f0036b6240f3f93dc429c0c02
Parent:        2ab784440a2cbde7448a3f5e315f7e8a8cbcf729
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Mon Oct 15 14:43:25 2018 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Mon Oct 15 17:49:44 2018 +0200

cov: index off by one

Basically apply stable patch fdb6ef8a85e9adc4805202b3200b17bd3b351982 to internal libdm version.

---
 device_mapper/libdm-common.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
device_mapper/libdm-common.c +1 -1
index 111fff6..eec31d7 100644
@@ -1765,7 +1765,7 @@ static int _mountinfo_parse_line(const char *line, unsigned *maj, unsigned *min,
 			return 0;
 		}
 		devmapper += 12; /* skip fixed prefix */
-		for (i = 0; devmapper[i] && devmapper[i] != ' ' && i < sizeof(root); ++i)
+		for (i = 0; devmapper[i] && devmapper[i] != ' ' && i < sizeof(root)-1; ++i)
 			root[i] = devmapper[i];
 		root[i] = 0;
 		_unmangle_mountinfo_string(root, buf);