This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: [open-source] Re: Wish for 2002 ...
- From: James Antill <james at and dot org>
- To: <mouring at etoh dot eviladmin dot org>
- Cc: Markus Friedl <markus at openbsd dot org>, Linus Torvalds <torvalds at transmeta dot com>, Paul Eggert <eggert at twinsun dot com>, <leclerc at austin dot sns dot slb dot com>, <security-audit at ferret dot lmh dot ox dot ac dot uk>, <libc-alpha at sources dot redhat dot com>, <openssh at openbsd dot org>
- Date: 11 Jan 2002 14:46:51 -0500
- Subject: Re: [open-source] Re: Wish for 2002 ...
- References: <Pine.BSO.4.33.0201111306400.4650-100000@etoh.eviladmin.org>
<mouring@etoh.eviladmin.org> writes:
> On Fri, 11 Jan 2002, Linus Torvalds wrote:
>
> >
> > On Fri, 11 Jan 2002, Markus Friedl wrote:
> >
> > > On Thu, Jan 10, 2002 at 04:37:27PM -0800, Paul Eggert wrote:
> > > > len = strlen(challenge) + strlen(PROMPT) + 1;
> > > > p = xmalloc(len);
> > > > p[0] = '\0';
> > > > strlcat(p, challenge, len);
> > > > strlcat(p, PROMPT, len);
>
> No where else do we do this unless we are in a loop where we can not use
> strlcpy() to create a base string (or that I see off hand).
I see you are listed in the CREDITS file so here's a free clue...
/* non portable - easy */
if (apsrintf(&p, "%s%s", challenge, PROMPT) < 0)
/* error path -- looks like call abort() from above */;
/* portable - faster */
len_chal = strlen(challenge);
len_prompt = strlen(PROMPT);
tmp = p = xmalloc(len_chal + len_prompt + 1);
memcpy(tmp, challenge, len_chal);
tmp += len_chal;
memcpy(tmp, PROMPT, len_prompt + 1);
--
# James Antill -- james@and.org
:0:
* ^From: .*james@and\.org
/dev/null