* [PATCH] memshr: fix off-by-one in filename size check
@ 2013-11-28 10:17 Matthew Daley
2013-11-29 10:35 ` Ian Campbell
0 siblings, 1 reply; 4+ messages in thread
From: Matthew Daley @ 2013-11-28 10:17 UTC (permalink / raw)
To: xen-devel
Cc: xen-devel, Matthew Daley, Ian Jackson, Ian Campbell,
Stefano Stabellini
Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
---
tools/memshr/shm.c | 4 ++--
1 file 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 */
--
1.7.10.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] memshr: fix off-by-one in filename size check
2013-11-28 10:17 [PATCH] memshr: fix off-by-one in filename size check Matthew Daley
@ 2013-11-29 10:35 ` Ian Campbell
2013-11-29 15:17 ` Andres Lagar-Cavilla
0 siblings, 1 reply; 4+ messages in thread
From: Ian Campbell @ 2013-11-29 10:35 UTC (permalink / raw)
To: Matthew Daley
Cc: xen-devel, xen-devel, Ian Jackson, Andres Lagar-Cavilla,
Stefano Stabellini
On Thu, 2013-11-28 at 23:17 +1300, Matthew Daley wrote:
> Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
Acked + applied, thanks.
Andres -- should you have an entry in MAINTAINERS for this code?
> ---
> tools/memshr/shm.c | 4 ++--
> 1 file 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 */
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] memshr: fix off-by-one in filename size check
2013-11-29 10:35 ` Ian Campbell
@ 2013-11-29 15:17 ` Andres Lagar-Cavilla
2013-11-29 15:46 ` Ian Campbell
0 siblings, 1 reply; 4+ messages in thread
From: Andres Lagar-Cavilla @ 2013-11-29 15:17 UTC (permalink / raw)
To: Ian Campbell
Cc: Stefano Stabellini, Tim Deegan, Matthew Daley, Ian Jackson,
xen-devel, Andres Lagar-Cavilla, xen-devel
On Nov 29, 2013, at 5:35 AM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Thu, 2013-11-28 at 23:17 +1300, Matthew Daley wrote:
>> Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
>
> Acked + applied, thanks.
>
> Andres -- should you have an entry in MAINTAINERS for this code?
I manipulated memshr as a side-effect of hypervisor/x86/mem_sharing. It's not my "baby" per se.
I think it'd be more appropriate for me to maintain hypervisor/x86/mem_sharing, and if so, I can take a stab at tools/memshr as well.
Of course, that discussion would involve Tim D (cc) and possibly others.
Thanks
Andres
>
>> ---
>> tools/memshr/shm.c | 4 ++--
>> 1 file 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 */
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] memshr: fix off-by-one in filename size check
2013-11-29 15:17 ` Andres Lagar-Cavilla
@ 2013-11-29 15:46 ` Ian Campbell
0 siblings, 0 replies; 4+ messages in thread
From: Ian Campbell @ 2013-11-29 15:46 UTC (permalink / raw)
To: Andres Lagar-Cavilla
Cc: Stefano Stabellini, Tim Deegan, Matthew Daley, Ian Jackson,
xen-devel, Andres Lagar-Cavilla, xen-devel
On Fri, 2013-11-29 at 10:17 -0500, Andres Lagar-Cavilla wrote:
> On Nov 29, 2013, at 5:35 AM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
>
> > On Thu, 2013-11-28 at 23:17 +1300, Matthew Daley wrote:
> >> Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
> >
> > Acked + applied, thanks.
> >
> > Andres -- should you have an entry in MAINTAINERS for this code?
> I manipulated memshr as a side-effect of hypervisor/x86/mem_sharing. It's not my "baby" per se.
>
> I think it'd be more appropriate for me to maintain hypervisor/x86/mem_sharing, and if so, I can take a stab at tools/memshr as well.
>
> Of course, that discussion would involve Tim D (cc) and possibly others.
The best way to kick it off would be with a patch to MAINTAINERS I
think.
Ian.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-11-29 15:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-28 10:17 [PATCH] memshr: fix off-by-one in filename size check Matthew Daley
2013-11-29 10:35 ` Ian Campbell
2013-11-29 15:17 ` Andres Lagar-Cavilla
2013-11-29 15:46 ` Ian Campbell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).