[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] memshr: fix off-by-one in filename size check
commit 29f3dc1e0715bc9237761ce4a39aed3610a86a85 Author: Matthew Daley <mattd@xxxxxxxxxxx> AuthorDate: Thu Nov 28 23:17:11 2013 +1300 Commit: Ian Campbell <ian.campbell@xxxxxxxxxx> CommitDate: Fri Nov 29 10:29:04 2013 +0000 memshr: fix off-by-one in filename size check Signed-off-by: Matthew Daley <mattd@xxxxxxxxxxx> Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx> --- tools/memshr/shm.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/memshr/shm.c b/tools/memshr/shm.c index c925cf2..30975dc 100644 --- a/tools/memshr/shm.c +++ b/tools/memshr/shm.c @@ -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 */ -- generated by git-patchbot for /home/xen/git/xen.git#master _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |