fix checking strtab length in xc_core.c
PATCH 1/1 fix checking strtab length in xc_core.c
Hi,
I don't understard the meaning of the following check in xc_core.c. Is this correct patch?
Signed-off-by Akio Takebe <[email protected]>
tools/libxc/xc_core.c +1 -1
@@ -107,7 +107,7 @@ xc_core_strtab_get(struct xc_core_strtabif ( strtab->current + len > strtab->max ) {char *tmp; -if ( strtab->max *2 < strtab->max ) +if ( strtab->current + len > strtab->max *2 ) {PERROR ("too long string table" ); errno =ENOMEM ;
Best Regards,
Akio Takebe
tools/libxc/xc_core.c +1 -1
@@ -107,7 +107,7 @@ xc_core_strtab_get(struct xc_core_strtabif ( strtab->current + len > strtab->max ) {char *tmp; -if ( strtab->max *2 < strtab->max ) +if ( strtab->current + len > strtab->max *2 ) {PERROR ("too long string table" ); errno =ENOMEM ;
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 4 lines · Akio Takebe
I don't understard the meaning of the following check in
xc_core.c. Is this correct patch?Signed-off-by Akio Takebe <[email protected]>
It's to avoid overflowing a fixed-size integer.
-- Keir
Hi, Keir
Quoted 3 lines
It's to avoid overflowing a fixed-size integer.
-- Keir
Thanks.
Best Regards,
Akio Takebe