[624] in Zephyr_Bugs

home help back first fref pref prev next nref lref last post

Re: serious bug in brain dump code (zephyr 2.0 beta 2)

daemon@ATHENA.MIT.EDU (E. Jay Berkenbilt)
Wed Jul 12 09:53:00 1995

Date: Wed, 12 Jul 1995 09:49:41 -0400
From: "E. Jay Berkenbilt" <ejb@ERA.COM>
To: ghudson@MIT.EDU
Cc: bug-zephyr@MIT.EDU
In-Reply-To: <199507120208.WAA08389@lola-granola.MIT.EDU> (message from Greg
	Hudson on Tue, 11 Jul 1995 22:08:05 -0400)


Here is a small patch relative to your patch to allow this to
compile.  You were calling ZMakeAscii and ZReadAscii with the wrong
number of arguments.  I don't know the calling sequence for these, but
based on the code for the two routines, I believe this should do.
BTW, I never compile anything serious without -Wall.  I have an
autoconf test that I use to determine whether -Wno-implicit would be
good as well.  (I do my development on machines with prototypes for
all functions and don't use -Wno-implicit.  Then, in production, I
test to see whether "printf" is declared, and if not, add
-Wno-implicit to my args if gcc is in use.  This suppresses warnings
for system and library calls with no prototypes, but would also, of
course, suppress warnings for home-grown functions without
prototypes...  Anyway, with -Wall, no warnings means all functions
have prototypes, and there are no argument type problems.)  I haven't
tested this yet, but I am about to.  Thanks for the patch!

                                Jay B


--- server/bdump.c.qdist	Wed Jul 12 09:27:24 1995
+++ server/bdump.c	Wed Jul 12 09:46:38 1995
@@ -586,6 +586,7 @@
 
     retval = ZMakeAscii(addrbuf, sizeof(addrbuf),
 			(unsigned char *) &addr->sin_addr,
+			sizeof(struct in_addr),
 			sizeof(struct in_addr));
     if (retval != ZERR_NONE)
 	return retval;
@@ -829,6 +830,7 @@
 	    retval = ZReadAscii(notice.z_other_fields[0],
 				strlen(notice.z_other_fields[0]),
 				(unsigned char *) &who.sin_addr,
+				sizeof(struct in_addr),
 				sizeof(struct in_addr));
 	    if (retval != ZERR_NONE) {
 		syslog(LOG_ERR, "brl zreadascii failed: %s",

home help back first fref pref prev next nref lref last post