All of lore.kernel.org
 help / color / mirror / Atom feed
From: Akio Takebe <takebe_akio@jp.fujitsu.com>
To: xen-devel <xen-devel@lists.xensource.com>
Subject: [Patch] fix checking strtab length in xc_core.c
Date: Mon, 10 Sep 2007 21:16:23 +0900	[thread overview]
Message-ID: <17C7F3A466F613takebe_akio@jp.fujitsu.com> (raw)

[-- Attachment #1: Mail message body --]
[-- Type: text/plain, Size: 666 bytes --]

Hi,

I don't understard the meaning of the following check in xc_core.c.
Is this correct patch?

Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>

diff -r 9071521d4864 tools/libxc/xc_core.c
--- a/tools/libxc/xc_core.c	Fri Sep 07 11:39:10 2007 +0100
+++ b/tools/libxc/xc_core.c	Tue Sep 11 06:13:55 2007 +0900
@@ -107,7 +107,7 @@ xc_core_strtab_get(struct xc_core_strtab
     if ( 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

[-- Attachment #2: fix_xc_core_strtab_len.patch --]
[-- Type: application/octet-stream, Size: 485 bytes --]

diff -r 9071521d4864 tools/libxc/xc_core.c
--- a/tools/libxc/xc_core.c	Fri Sep 07 11:39:10 2007 +0100
+++ b/tools/libxc/xc_core.c	Tue Sep 11 06:13:55 2007 +0900
@@ -107,7 +107,7 @@ xc_core_strtab_get(struct xc_core_strtab
     if ( 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;

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

             reply	other threads:[~2007-09-10 12:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-10 12:16 Akio Takebe [this message]
2007-09-10 12:20 ` [Patch] fix checking strtab length in xc_core.c Keir Fraser
2007-09-10 12:33   ` Akio Takebe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=17C7F3A466F613takebe_akio@jp.fujitsu.com \
    --to=takebe_akio@jp.fujitsu.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.