Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATH_MAX used dangerously -- do we care?
- X-seq: zsh-workers 1582
- From: Zoltan Hidvegi <hzoli@xxxxxxxxxx>
- To: schaefer@xxxxxxx
- Subject: Re: PATH_MAX used dangerously -- do we care?
- Date: Tue, 9 Jul 1996 02:40:44 +0200 (MET DST)
- Cc: zsh-workers@xxxxxxxxxxxxxxx
- In-reply-to: <960707093403.ZM4311@xxxxxxxxxxxxxxxxxxxxxxx> from Bart Schaefer at "Jul 7, 96 09:34:01 am"
- Organization: Dept. of Comp. Sci., Eotvos University, Budapest, Hungary
- Phone: (36 1)2669833 ext: 2667, home phone: (36 1) 2752368
> I can find at least half a dozen places where some form of user input is
> sprintf'd or strcpy'd into a PATH_MAX-sized stack buffer or static buffer.
> The most obvious one is in sourcehome() in init.c, where $ZDOTDIR plus a
> slash and file name is sprintf'd into such a buffer.
>
> In all cases I found, the string being placed in the buffer really is a
> path name, so PATH_MAX is a reasonable limit upon it; so I don't suggest
> switching to dynamic buffers, but shouldn't there be a bounds check?
Yes there should be. If you know the places where it should be fexed, send
in that list or send a patch which fixes that. There can be two solutions:
we can silently truncate the string or we may give some error message and
refuse to do anything with the string. The later is probably more correct
behaviour. Perhaps the behaviour of other shells can be examined before
the decision.
Zoltan
Messages sorted by:
Reverse Date,
Date,
Thread,
Author