[948] in Zephyr_Bugs
Bug in XZwrite (zephyr-2.0.4)
daemon@ATHENA.MIT.EDU (Geoffrey E. Reedy)
Tue Jul 28 12:41:43 1998
Date: Tue, 28 Jul 1998 11:41:38 -0500
From: "Geoffrey E. Reedy" <vader21@imsa.edu>
To: zephyr-bugs@MIT.EDU
Cc: "Geoffrey E. Reedy" <vader21@imsa.edu>
--LQksG6bCIzRHxTLp
Content-Type: text/plain; charset=us-ascii
There is a logic error in XZwrite. An attempt is made to malloc a negative
amount of memory. In logins.c subtraction was reversed causing the
erraneous value. A unified diff is attached, have fun.
--
Geoffrey Reedy Student Network System Administrator
vader21@imsa.edu llinois Math and Science Academy
--LQksG6bCIzRHxTLp
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="logins.c.diff"
--- clients/xzwrite/logins.c Tue Jul 28 11:04:32 1998
+++ clients/xzwrite/logins.c.orig Tue Jul 28 10:56:38 1998
@@ -12,7 +12,7 @@
char *newdest;
int d;
- d = strchr(notice->z_class_inst, '@') - notice->z_class_inst;
+ d = notice->z_class_inst - strchr(notice->z_class_inst, '@');
newdest = (char *) Malloc(d+1, "while dealing with login/logout notice",
NULL);
strncpy(newdest, notice->z_class_inst, d);
--LQksG6bCIzRHxTLp--