[279] in Zephyr Mailing List
Re: xzwrite out of memory
daemon@ATHENA.MIT.EDU (Steven Freed)
Thu Jun 11 19:28:34 1998
Date: Thu, 11 Jun 1998 17:27:18 -0600 (MDT)
From: Steven Freed <sfreed@gilasoft.com>
Reply-To: sfreed@gilasoft.com
To: zephyr@MIT.EDU
In-Reply-To: <Pine.BSI.3.95.980611110725.24442C-100000@taos.gilasoft.com>
On Thu, 11 Jun 1998, Steven Freed wrote:
> Out of memory: while dealing with login/logout notice
To answer my own question on this, in clients/xzwrite/logins.c, line 15,
it has:
d = notice->z_class_inst - strchr(notice->z_class_inst, '@');
I really don't know how this has ever worked for anyone since it will
always return a negative number (or something really bogus if there is no
"@"). Most mallocs I've ever worked with do not allocate negative amounts
of memory very well.
What you really want is something like this: (I've added a bit of error
checking)
if (strchr(notice->z_class_inst, '@') == NULL) {
Warning("Invalid login/logout notice. No '@'\n", NULL);
return;
}
d = strchr(notice->z_class_inst, '@') - notice->z_class_inst;
Is anyone still working on this so the source tree can get patched?
I haven't gotten any answers on my zpopnotify question so if anyone knows
how this is done, please let me know.
--
Steven..