[cvslog] [CVS] Module eggdrop1.6: Change committed

cvs at eggheads.org cvs at eggheads.org
Thu Feb 18 07:11:31 CST 2010


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.6
Commit time: 2010-02-18 13:11:30 UTC
Committer  : Rumen Stoyanov <pseudo at egg6.net>

Modified files:
     doc/Changes1.6 src/patch.h src/mod/dns.mod/coredns.c

Log message:

Fixed dns.mod SIGBUS crashes on 64-bit Sparc.
Fixes Bugzilla Bug # 454 "Eggdrop crashes on sun sparc running debian etch"

---------------------- diff included ----------------------
Index: eggdrop1.6/doc/Changes1.6
diff -u eggdrop1.6/doc/Changes1.6:1.66 eggdrop1.6/doc/Changes1.6:1.67
--- eggdrop1.6/doc/Changes1.6:1.66	Thu Feb 18 07:03:04 2010
+++ eggdrop1.6/doc/Changes1.6	Thu Feb 18 07:11:20 2010
@@ -1,4 +1,4 @@
-$Id: Changes1.6,v 1.66 2010/02/18 13:03:04 pseudo Exp $
+$Id: Changes1.6,v 1.67 2010/02/18 13:11:20 pseudo Exp $
 
 Eggdrop Changes (since version 1.6.0)
 
@@ -6,6 +6,10 @@
 
 1.6.20 (CVS):
 
+  - Fixed dns.mod SIGBUS crashes on 64-bit Sparc.
+    Fixes Bugzilla Bug # 454 "Eggdrop crashes on sun sparc running debian etch"
+    Found by: soraver / Patch by: pseudo
+
   - Got rid of some compile warnings related to passing possibly signed chars
     to tolower().
     Patch by: pseudo
Index: eggdrop1.6/src/mod/dns.mod/coredns.c
diff -u eggdrop1.6/src/mod/dns.mod/coredns.c:1.33 eggdrop1.6/src/mod/dns.mod/coredns.c:1.34
--- eggdrop1.6/src/mod/dns.mod/coredns.c:1.33	Sun Jan  3 07:27:42 2010
+++ eggdrop1.6/src/mod/dns.mod/coredns.c	Thu Feb 18 07:11:20 2010
@@ -5,7 +5,7 @@
  *
  * Modified/written by Fabian Knittel <fknittel at gmx.de>
  *
- * $Id: coredns.c,v 1.33 2010/01/03 13:27:42 pseudo Exp $
+ * $Id: coredns.c,v 1.34 2010/02/18 13:11:20 pseudo Exp $
  */
 /*
  * Portions Copyright (C) 1999 - 2010 Eggheads Development Team
@@ -566,8 +566,15 @@
 {
   packetheader *hp;
   int r, i;
-  u_8bit_t buf[(MAX_PACKETSIZE / sizeof(char)) + 1];
+  u_8bit_t *buf;
 
+  /* Use malloc here instead of a static buffer, as per res_mkquery()'s manual
+   * buf should be aligned on an eight byte boundary. malloc() should return a
+   * pointer to an address properly aligned for any data type. Failing to
+   * provide a aligned buffer will result in a SIGBUS crash atleast on SPARC
+   * CPUs.
+   */
+  buf = nmalloc(MAX_PACKETSIZE + 1);
   r = res_mkquery(QUERY, s, C_IN, type, NULL, 0, NULL, buf, MAX_PACKETSIZE);
   if (r == -1) {
     ddebug0(RES_ERR "Query too large.");
@@ -579,6 +586,7 @@
     (void) sendto(resfd, buf, r, 0,
                   (struct sockaddr *) &_res.nsaddr_list[i],
                   sizeof(struct sockaddr));
+  nfree(buf);
 }
 
 /* (Re-)send request with existing id.
Index: eggdrop1.6/src/patch.h
diff -u eggdrop1.6/src/patch.h:1.1236 eggdrop1.6/src/patch.h:1.1237
--- eggdrop1.6/src/patch.h:1.1236	Thu Feb 18 07:03:04 2010
+++ eggdrop1.6/src/patch.h	Thu Feb 18 07:11:20 2010
@@ -10,7 +10,7 @@
  * statement, leave the rest of the file alone, this allows better
  * overlapping patches.
  *
- * $Id: patch.h,v 1.1236 2010/02/18 13:03:04 pseudo Exp $
+ * $Id: patch.h,v 1.1237 2010/02/18 13:11:20 pseudo Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -41,12 +41,12 @@
  *
  *
  */
-patch("1266487660");            /* current unixtime */
+patch("1266498659");            /* current unixtime */
 /*
  *
  *
  */
-patch("unsigned-tolower");
+patch("sparcdnsfix");
 /*
  *
  *
----------------------- End of diff -----------------------


More information about the Changes mailing list