Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Aleksandar Ristovski <aristovski@qnx.com>
To: gdb-patches@sources.redhat.com
Subject: [patch] buffer overflow in symtab_from_filename
Date: Thu, 25 Aug 2011 16:06:00 -0000	[thread overview]
Message-ID: <j35rrb$m07$1@dough.gmane.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 372 bytes --]

Hello,

There is an issue in symtab_from_filename function, it may buffer 
overflow by advancing past the end of the string.

The patch makes sure we do not advance past zero terminator.

Thanks,

Aleksandar Ristovski
QNX Software Systems


ChangeLog:
Aleksandar Ristovski <aristovski@qnx.com>

         * linespec.c (symtab_from_filename): Check for the end of string.



[-- Attachment #2: linespec-201108251155.patch --]
[-- Type: text/x-patch, Size: 507 bytes --]

Index: gdb/linespec.c
===================================================================
RCS file: /cvs/src/src/gdb/linespec.c,v
retrieving revision 1.129
diff -u -p -r1.129 linespec.c
--- gdb/linespec.c	18 Aug 2011 16:17:38 -0000	1.129
+++ gdb/linespec.c	25 Aug 2011 15:55:21 -0000
@@ -1835,6 +1835,8 @@ symtab_from_filename (char **argptr, cha
     }
 
   /* Discard the file name from the arg.  */
+  if (*p1 == '\0')
+    return file_symtab;
   p = p1 + 1;
   while (*p == ' ' || *p == '\t')
     p++;

             reply	other threads:[~2011-08-25 16:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-25 16:06 Aleksandar Ristovski [this message]
2011-08-25 17:34 ` Tom Tromey
2011-08-25 17:46   ` Aleksandar Ristovski
2011-08-25 18:12     ` Tom Tromey
2011-08-26 18:04       ` Aleksandar Ristovski

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='j35rrb$m07$1@dough.gmane.org' \
    --to=aristovski@qnx.com \
    --cc=gdb-patches@sources.redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox