mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
memshr: fix off-by-one in filename size check
Signed-off-by: Matthew Daley <mattd@bugfuzz.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
This commit is contained in:
1 parent
80507420f9
commit
29f3dc1e07
1 file changed
+2
-2
+2
-2
@@ -217,9 +217,9 @@ uint16_t shm_vbd_image_get(const char* file, vbd_image_info_t *vbd_imgs)
|
||||
DPRINTF("No space in vbds table.\n");
|
||||
return 0;
|
||||
}
|
||||
if(strlen(file) > MAX_NAME_LEN)
|
||||
if(strlen(file) > MAX_NAME_LEN - 1)
|
||||
{
|
||||
DPRINTF("Filename: %s too long (>%d).\n", file, MAX_NAME_LEN);
|
||||
DPRINTF("Filename: %s too long (>%d).\n", file, MAX_NAME_LEN - 1);
|
||||
return 0;
|
||||
}
|
||||
/* Init the entry */
|
||||
|
||||