From 77aa055e8a34eb7f0036b6240f3f93dc429c0c02 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Mon, 15 Oct 2018 14:43:25 +0200 Subject: [PATCH] cov: index off by one Basically apply stable patch fdb6ef8a85e9adc4805202b3200b17bd3b351982 to internal libdm version. --- device_mapper/libdm-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/device_mapper/libdm-common.c b/device_mapper/libdm-common.c index 111fff680..eec31d7fb 100644 --- a/device_mapper/libdm-common.c +++ b/device_mapper/libdm-common.c @@ -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);