tags 413174 patch
thanks

Hi Phil,

Running acm under valgrind points to a couple bits of uninitialized memory
as the culprits here.  With the attached patch, acm starts up for me and
seems to work properly (or as properly as I guess I can expect without a
joystick).

Let me know if you want me to NMU.

Cheers,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
[EMAIL PROTECTED]                                   http://www.debian.org/
diff -u acm-5.0/src/dis_if.c acm-5.0/src/dis_if.c
--- acm-5.0/src/dis_if.c
+++ acm-5.0/src/dis_if.c
@@ -21,6 +21,8 @@
 
 #include <stdio.h>
 #include <math.h>
+#include <stdlib.h>
+#include <string.h>
 #ifndef WIN32
 #include <sys/time.h>
 #endif
@@ -381,7 +383,7 @@
  *  Allocate storage for the entity table and initialize it.
  */
 
-	entities = (Entity_t *) malloc(sizeof(Entity_t) * MAX_ENTITIES);
+	entities = (Entity_t *) calloc(MAX_ENTITIES, sizeof(Entity_t));
 	for (i = 0; i < MAX_ENTITIES; i++) {
 		entities[i].local = -1;
 	}
@@ -943,6 +945,7 @@
 	dis_pdu   pdu;
 	int       i;
 
+	memset(&pdu,0,sizeof(dis_pdu));
 	if (network_enabled == 0) {
 		return 0;
 	}
diff -u acm-5.0/debian/changelog acm-5.0/debian/changelog
--- acm-5.0/debian/changelog
+++ acm-5.0/debian/changelog
@@ -1,3 +1,12 @@
+acm (5.0-23.1) unstable; urgency=high
+
+  * Non-maintainer upload.
+  * High-urgency upload for RC bugfix.
+  * Fix several initialization bugs that can trigger crashes on some
+    architectures.  Closes: #413174.
+
+ -- Steve Langasek <[EMAIL PROTECTED]>  Tue,  6 Mar 2007 18:05:34 -0800
+
 acm (5.0-23) unstable; urgency=low
 
   * Applied patch from Petr Salinger to fix FTBFS on GNU/kFreeBSD

Reply via email to