Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [commit] objc-lang.c: avoid string overrun
@ 2011-02-28  4:10 Michael Snyder
  2011-02-28  4:52 ` Jan Kratochvil
  2011-02-28 12:21 ` Pedro Alves
  0 siblings, 2 replies; 6+ messages in thread
From: Michael Snyder @ 2011-02-28  4:10 UTC (permalink / raw)
  To: gdb-patches

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



[-- Attachment #2: strncpy2.txt --]
[-- Type: text/plain, Size: 726 bytes --]

2011-02-27  Michael Snyder  <msnyder@vmware.com>

	* objc-lang.c (selectors_info): Prevent string overrun.

Index: objc-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/objc-lang.c,v
retrieving revision 1.91
diff -u -p -u -p -r1.91 objc-lang.c
--- objc-lang.c	10 Jan 2011 20:38:49 -0000	1.91
+++ objc-lang.c	28 Feb 2011 02:13:37 -0000
@@ -720,7 +720,7 @@ selectors_info (char *regexp, int from_t
 	strcpy(myregexp, ".*]");
       else
 	{
-	  strcpy(myregexp, regexp);
+	  strncpy(myregexp, regexp, sizeof (myregexp) - 1);
 	  if (myregexp[strlen(myregexp) - 1] == '$') /* end of selector */
 	    myregexp[strlen(myregexp) - 1] = ']';    /* end of method name */
 	  else

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

end of thread, other threads:[~2011-02-28 18:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-28  4:10 [commit] objc-lang.c: avoid string overrun Michael Snyder
2011-02-28  4:52 ` Jan Kratochvil
2011-02-28 18:02   ` Michael Snyder
2011-02-28 18:15     ` Jan Kratochvil
2011-02-28 12:21 ` Pedro Alves
2011-02-28 18:27   ` Michael Snyder

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