Gerhard Niklasch on Wed, 4 Mar 1998 02:53:14 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Strange behavior with Red Hat linux 5.0


In further response to...
> Message-Id: <199803032354.PAA05510@abyssinian.berkeley.edu>
> To: Gerhard Niklasch <nikl@pchelwig1.mathematik.tu-muenchen.de>
> Date: Tue, 03 Mar 1998 15:54:03 -0800
> From: Roland Dreier <dreier@math.berkeley.edu>

(Forget my rambling about stack traces, I wasn't quite paying attention)

Having spent a few minutes staring at the code -- does the following
help, or do we have another problem elsewhere?  (And folks in Bordeaux,
does this fix that strange three-or-four-character-username problem
from a week or two ago?  I think the symptoms might have been just the
right ones...)


diff -u src/language/es.c.orig src/language/es.c
--- src/language/es.c.orig      Wed Mar  4 02:44:29 1998
+++ src/language/es.c   Wed Mar  4 02:45:57 1998
@@ -1738,7 +1738,7 @@
     p = getpwnam(tmp); free(tmp);
   }
   if (!p) err(talker2,"unknown user ",s,s-1);
-  len = strlen(p->pw_dir) + strlen(u);
+  len = strlen(p->pw_dir) + strlen(u) + 1;
   if (!buf) buf = gpmalloc(len);
   else if (len >= max)
     err(talker,"name too long for buffer in expand_tilde");


(Harrumph.  This kind of thing has a way of slipping into the most
experienced C programmers' code!)

Good luck, Gerhard