Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch] buffer overflow in symtab_from_filename
@ 2011-08-25 16:06 Aleksandar Ristovski
  2011-08-25 17:34 ` Tom Tromey
  0 siblings, 1 reply; 5+ messages in thread
From: Aleksandar Ristovski @ 2011-08-25 16:06 UTC (permalink / raw)
  To: gdb-patches

[-- 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++;

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-08-26 18:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-25 16:06 [patch] buffer overflow in symtab_from_filename Aleksandar Ristovski
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox