diff src/sound.c @ 3504:3151d67d15d2

[xemacs-hg @ 2006-07-11 23:40:15 by james] Fix a dangerous strcpy by ensuring that the target string is exactly big enough to hold the data. <m3irm9ywg0.fsf@jerrypc.cs.usu.edu>
author james
date Tue, 11 Jul 2006 23:40:17 +0000
parents 34cfe24248f6
children 4bcad369dfd4
line wrap: on
line diff
--- a/src/sound.c	Tue Jul 11 23:36:21 2006 +0000
+++ b/src/sound.c	Tue Jul 11 23:40:17 2006 +0000
@@ -640,7 +640,7 @@
 		DEVICE_ON_CONSOLE_P (d) = 0;
 	      else
 		{
-		  Extbyte hn [255];
+		  Extbyte *hn = alloca_array (Extbyte, strlen (h->h_name) + 1);
 		  struct hostent *l;
 		  strcpy (hn, h->h_name);
 		  l = gethostbyname (localname);