PATCH 21.5
Here is how I would like to fix the dangerous strcpy we discussed
recently on xemacs-beta. The solution is to make the target area
precisely the right size to hold the copied string.
Is there seriously no Xlib function whatsoever to tell you if the server
is local or remote? Really?
src/ChangeLog addition:
2006-07-07 Jerry James <james(a)xemacs.org>
* sound.c (init_native_sound): Make the target of a strcpy be
exactly the right size to hold the copied string.
xemacs-21.5 source patch:
Diff command: cvs -q diff -uN
Files affected: src/sound.c
Index: src/sound.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/sound.c,v
retrieving revision 1.26
diff -d -u -r1.26 sound.c
--- src/sound.c 2006/03/27 17:40:59 1.26
+++ src/sound.c 2006/07/07 20:44:16
@@ -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);
--
Jerry James, Assistant Professor james(a)xemacs.org
Computer Science Department
http://www.cs.usu.edu/~jerry/
Utah State University